django2.2: remove direct assignments to many-to-many fields

This commit is contained in:
2019-10-06 02:15:18 +02:00
parent 97c316b62e
commit 99c8d95443
5 changed files with 37 additions and 31 deletions

View File

@ -152,8 +152,8 @@ class Forum(models.Model):
"""Copy, if possible, the rights of the parent folder"""
if self.parent is not None:
self.owner_club = self.parent.owner_club
self.edit_groups = self.parent.edit_groups.all()
self.view_groups = self.parent.view_groups.all()
self.edit_groups.set(self.parent.edit_groups.all())
self.view_groups.set(self.parent.view_groups.all())
self.save()
_club_memberships = {} # This cache is particularly efficient: