mirror of https://gitlab.crans.org/bde/nk20
Force delete some objects
This commit is contained in:
parent
0c0aed0234
commit
e63219f7ad
|
@ -85,7 +85,8 @@ def pre_delete_object(instance, **kwargs):
|
|||
if instance._meta.label_lower in EXCLUDED:
|
||||
return
|
||||
|
||||
if hasattr(instance, "_force_delete"):
|
||||
if hasattr(instance, "_force_delete") or hasattr(instance, "pk") and instance.pk == 0:
|
||||
# Don't check permissions on force-deleted objects
|
||||
return
|
||||
|
||||
user = get_current_authenticated_user()
|
||||
|
|
Loading…
Reference in New Issue