Hide user pages to blocked users

This commit is contained in:
Mouse Reeve
2021-01-26 08:31:55 -08:00
parent 681f5482fd
commit 3f011445e2
3 changed files with 56 additions and 4 deletions

View File

@ -190,3 +190,9 @@ def handle_reading_status(user, shelf, book, privacy):
status.save()
broadcast(user, status.to_create_activity(user))
def is_blocked(viewer, user):
''' is this viewer blocked by the user? '''
if viewer.is_authenticated and viewer in user.blocks.all():
return True
return False