mirror of
https://github.com/bookwyrm-social/bookwyrm.git
synced 2024-12-11 10:46:37 +00:00
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:
parent
8496f24032
commit
8708d71f4b
2 changed files with 3 additions and 3 deletions
|
@ -84,8 +84,8 @@ class BookWyrmModel(models.Model):
|
||||||
# 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"):
|
||||||
if (
|
if (
|
||||||
hasattr(self.group, "members")
|
hasattr(self.group, "memberships")
|
||||||
and viewer in self.group.members.all()
|
and self.group.memberships.filter(user=viewer).exists()
|
||||||
):
|
):
|
||||||
return True
|
return True
|
||||||
|
|
||||||
|
|
|
@ -26,7 +26,7 @@ class Group(View):
|
||||||
|
|
||||||
group = get_object_or_404(models.Group, id=group_id)
|
group = get_object_or_404(models.Group, id=group_id)
|
||||||
lists = models.List.objects.filter(group=group).order_by("-updated_date")
|
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
|
# don't show groups to users who shouldn't see them
|
||||||
if not group.visible_to_user(request.user):
|
if not group.visible_to_user(request.user):
|
||||||
|
|
Loading…
Reference in a new issue