mirror of https://gitlab.crans.org/bde/nk20
🐛 Force delete didn't work as well when trying to check add permissions
This commit is contained in:
parent
fb775de923
commit
0c0aed0234
|
@ -44,7 +44,9 @@ class InstancedPermission:
|
||||||
else:
|
else:
|
||||||
oldpk = obj.pk
|
oldpk = obj.pk
|
||||||
# Ensure previous models are deleted
|
# Ensure previous models are deleted
|
||||||
self.model.model_class().objects.filter(pk=obj.pk).annotate(_force_delete=F("pk")).delete()
|
for o in self.model.model_class().objects.filter(pk=obj.pk).all():
|
||||||
|
o._force_delete = True
|
||||||
|
Model.delete(o)
|
||||||
# Force insertion, no data verification, no trigger
|
# Force insertion, no data verification, no trigger
|
||||||
obj._force_save = True
|
obj._force_save = True
|
||||||
Model.save(obj, force_insert=True)
|
Model.save(obj, force_insert=True)
|
||||||
|
|
Loading…
Reference in New Issue