CASCADE group.user

Delete groups when group.user is deleted.
This commit is contained in:
Hugh Rundle 2021-10-08 21:21:19 +11:00
parent 39e002ee13
commit 056150d583

View file

@ -11,7 +11,7 @@ class Group(BookWyrmModel):
"""A group of users""" """A group of users"""
name = fields.CharField(max_length=100) name = fields.CharField(max_length=100)
user = fields.ForeignKey("User", on_delete=models.PROTECT) user = fields.ForeignKey("User", on_delete=models.CASCADE)
description = fields.TextField(blank=True, null=True) description = fields.TextField(blank=True, null=True)
privacy = fields.PrivacyField() privacy = fields.PrivacyField()