mirror of
https://github.com/bookwyrm-social/bookwyrm.git
synced 2024-11-27 03:51:08 +00:00
More thorough check to prevent following blocked users
This commit is contained in:
parent
d250127062
commit
4a58cd42a6
1 changed files with 7 additions and 2 deletions
|
@ -82,11 +82,16 @@ class UserFollowRequest(ActivitypubMixin, UserRelationship):
|
||||||
try:
|
try:
|
||||||
UserFollows.objects.get(
|
UserFollows.objects.get(
|
||||||
user_subject=self.user_subject,
|
user_subject=self.user_subject,
|
||||||
user_object=self.user_object
|
user_object=self.user_object,
|
||||||
)
|
)
|
||||||
|
# blocking in either direction is a no-go
|
||||||
UserBlocks.objects.get(
|
UserBlocks.objects.get(
|
||||||
user_subject=self.user_subject,
|
user_subject=self.user_subject,
|
||||||
user_object=self.user_object
|
user_object=self.user_object,
|
||||||
|
)
|
||||||
|
UserBlocks.objects.get(
|
||||||
|
user_subject=self.user_object,
|
||||||
|
user_object=self.user_subject,
|
||||||
)
|
)
|
||||||
return None
|
return None
|
||||||
except (UserFollows.DoesNotExist, UserBlocks.DoesNotExist):
|
except (UserFollows.DoesNotExist, UserBlocks.DoesNotExist):
|
||||||
|
|
Loading…
Reference in a new issue