change group owner from 'manager' to 'user'
This will allow privacy management to use existing code. Some template updates also are for rationalising how groups are created and edited.
This commit is contained in:
parent
2874e52309
commit
f3181690a2
10 changed files with 17 additions and 12 deletions
|
@ -76,6 +76,10 @@ class BookWyrmModel(models.Model):
|
|||
and self.mention_users.filter(id=viewer.id).first()
|
||||
):
|
||||
return True
|
||||
|
||||
# TODO: if privacy is direct and the object is a group and viewer is a member of the group
|
||||
# then return True
|
||||
|
||||
return False
|
||||
|
||||
|
||||
|
|
|
@ -12,7 +12,7 @@ class Group(BookWyrmModel):
|
|||
"""A group of users"""
|
||||
|
||||
name = fields.CharField(max_length=100)
|
||||
manager = fields.ForeignKey(
|
||||
user = fields.ForeignKey(
|
||||
"User", on_delete=models.PROTECT)
|
||||
description = fields.TextField(blank=True, null=True)
|
||||
privacy = fields.PrivacyField()
|
||||
|
|
|
@ -36,9 +36,10 @@ class List(OrderedCollectionMixin, BookWyrmModel):
|
|||
)
|
||||
group = models.ForeignKey(
|
||||
"Group",
|
||||
on_delete=models.CASCADE,
|
||||
on_delete=models.PROTECT,
|
||||
default=None,
|
||||
blank=True
|
||||
blank=True,
|
||||
null=True,
|
||||
)
|
||||
books = models.ManyToManyField(
|
||||
"Edition",
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue