Force delete some objects
This commit is contained in:
parent
0c0aed0234
commit
e63219f7ad
1 changed files with 2 additions and 1 deletions
|
|
@ -85,7 +85,8 @@ def pre_delete_object(instance, **kwargs):
|
||||||
if instance._meta.label_lower in EXCLUDED:
|
if instance._meta.label_lower in EXCLUDED:
|
||||||
return
|
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
|
return
|
||||||
|
|
||||||
user = get_current_authenticated_user()
|
user = get_current_authenticated_user()
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue