forked from mirrors/bookwyrm
lint raise_visible_to_user
Don't return True unnecessarily
This commit is contained in:
parent
da53bad0f5
commit
78f5003407
1 changed files with 3 additions and 3 deletions
|
@ -79,14 +79,14 @@ class BookWyrmModel(models.Model):
|
||||||
and self.mention_users.filter(id=viewer.id).first()
|
and self.mention_users.filter(id=viewer.id).first()
|
||||||
):
|
):
|
||||||
|
|
||||||
return True
|
return
|
||||||
|
|
||||||
# you can see groups of which you are a member
|
# you can see groups of which you are a member
|
||||||
if (
|
if (
|
||||||
hasattr(self, "memberships")
|
hasattr(self, "memberships")
|
||||||
and self.memberships.filter(user=viewer).exists()
|
and self.memberships.filter(user=viewer).exists()
|
||||||
):
|
):
|
||||||
return True
|
return
|
||||||
|
|
||||||
# you can see objects which have a group of which you are a member
|
# you can see objects which have a group of which you are a member
|
||||||
if hasattr(self, "group"):
|
if hasattr(self, "group"):
|
||||||
|
@ -94,7 +94,7 @@ class BookWyrmModel(models.Model):
|
||||||
hasattr(self.group, "memberships")
|
hasattr(self.group, "memberships")
|
||||||
and self.group.memberships.filter(user=viewer).exists()
|
and self.group.memberships.filter(user=viewer).exists()
|
||||||
):
|
):
|
||||||
return True
|
return
|
||||||
|
|
||||||
raise Http404()
|
raise Http404()
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue