group members can see lists

- fix visible_to_user for group objects (like lists)
- temporarily disable privacy_filter on group lists
This commit is contained in:
Hugh Rundle 2021-10-02 18:31:56 +10:00
parent 8496f24032
commit 8708d71f4b
2 changed files with 3 additions and 3 deletions

View file

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

View file

@ -26,7 +26,7 @@ class Group(View):
group = get_object_or_404(models.Group, id=group_id)
lists = models.List.objects.filter(group=group).order_by("-updated_date")
lists = privacy_filter(request.user, lists)
# lists = privacy_filter(request.user, lists)
# don't show groups to users who shouldn't see them
if not group.visible_to_user(request.user):