you can delete AccessRestriction objects if only AccessPermissions depend on it
This commit is contained in:
parent
7e288213c1
commit
06c56abf51
1 changed files with 2 additions and 0 deletions
|
@ -280,6 +280,8 @@ class ChangedObject(models.Model):
|
|||
related_model = field.related_model
|
||||
if related_model._meta.app_label != 'mapdata':
|
||||
continue
|
||||
if related_model.__name__ == 'AccessPermission':
|
||||
continue
|
||||
kwargs = {field.field.name+'__pk': self.obj_pk}
|
||||
if self.changeset.wrap_model(related_model).objects.filter(**kwargs).exists():
|
||||
return False
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue