mirror of
https://github.com/bookwyrm-social/bookwyrm.git
synced 2025-01-18 05:06:01 +00:00
fix raise_not_editable for group lists
This commit is contained in:
parent
603a9dc25c
commit
c04659984f
1 changed files with 10 additions and 0 deletions
|
@ -64,6 +64,16 @@ class List(OrderedCollectionMixin, BookWyrmModel):
|
||||||
|
|
||||||
ordering = ("-updated_date",)
|
ordering = ("-updated_date",)
|
||||||
|
|
||||||
|
def raise_not_editable(self, viewer):
|
||||||
|
"""the associated user OR the list owner can edit"""
|
||||||
|
print("raising not editable")
|
||||||
|
if self.user == viewer:
|
||||||
|
return
|
||||||
|
# group members can edit items in group lists
|
||||||
|
is_group_member = GroupMember.objects.filter(group=self.group, user=viewer).exists()
|
||||||
|
if is_group_member:
|
||||||
|
return
|
||||||
|
super().raise_not_editable(viewer)
|
||||||
|
|
||||||
class ListItem(CollectionItemMixin, BookWyrmModel):
|
class ListItem(CollectionItemMixin, BookWyrmModel):
|
||||||
"""ok"""
|
"""ok"""
|
||||||
|
|
Loading…
Reference in a new issue