fix visible_to_user for groups user is a member of

This commit is contained in:
Hugh Rundle 2021-10-02 20:52:19 +10:00
parent 72e00f75c9
commit eed9d44cfd

View file

@ -78,7 +78,7 @@ class BookWyrmModel(models.Model):
return True
# you can see groups of which you are a member
if hasattr(self, "members") and viewer in self.members.all():
if hasattr(self, "memberships") and self.memberships.filter(user=viewer).exists():
return True
# you can see objects which have a group of which you are a member