forked from mirrors/bookwyrm
Make sure user is available when testing blocks
This commit is contained in:
parent
b6a7871b04
commit
edf3fad54d
1 changed files with 1 additions and 1 deletions
|
@ -138,7 +138,7 @@ class User(OrderedCollectionPageMixin, AbstractUser):
|
||||||
def viewer_aware_objects(cls, viewer):
|
def viewer_aware_objects(cls, viewer):
|
||||||
""" the user queryset filtered for the context of the logged in user """
|
""" the user queryset filtered for the context of the logged in user """
|
||||||
queryset = cls.objects.filter(is_active=True)
|
queryset = cls.objects.filter(is_active=True)
|
||||||
if viewer.is_authenticated:
|
if viewer and viewer.is_authenticated:
|
||||||
queryset = queryset.exclude(blocks=viewer)
|
queryset = queryset.exclude(blocks=viewer)
|
||||||
return queryset
|
return queryset
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue