mirror of
https://github.com/bookwyrm-social/bookwyrm.git
synced 2024-11-27 20:11:14 +00:00
Don't allow blocked users to access user page
This commit is contained in:
parent
ac2ab2981f
commit
681f5482fd
1 changed files with 5 additions and 0 deletions
|
@ -31,6 +31,11 @@ class User(View):
|
|||
except models.User.DoesNotExist:
|
||||
return HttpResponseNotFound()
|
||||
|
||||
# make sure we're not blocked
|
||||
if request.user.is_authenticated:
|
||||
if request.user in user.blocks.all():
|
||||
return HttpResponseNotFound()
|
||||
|
||||
if is_api_request(request):
|
||||
# we have a json request
|
||||
return ActivitypubResponse(user.to_activity())
|
||||
|
|
Loading…
Reference in a new issue