Fixes privacy display
This commit is contained in:
parent
66a2b4c7c7
commit
c6caa5a3f4
2 changed files with 11 additions and 5 deletions
|
@ -220,6 +220,16 @@ class Status(OrderedCollectionPageMixin, BookWyrmModel):
|
|||
~Q(Q(user=viewer) | Q(mention_users=viewer)), privacy="direct"
|
||||
)
|
||||
|
||||
@classmethod
|
||||
def followers_filter(cls, queryset, viewer):
|
||||
"""Override-able filter for "followers" privacy level"""
|
||||
return queryset.exclude(
|
||||
~Q( # not yourself, a follower, or someone who is tagged
|
||||
Q(user__followers=viewer) | Q(user=viewer) | Q(mention_users=viewer)
|
||||
),
|
||||
privacy="followers", # and the status is followers only
|
||||
)
|
||||
|
||||
|
||||
class GeneratedNote(Status):
|
||||
"""these are app-generated messages about user activity"""
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue