Make it possible to fully delete unlisted/unrated extensions #81
@ -23,7 +23,7 @@ def _log_extension_delete(sender: object, instance: object, **kwargs: object) ->
|
|||||||
# FIXME: remove this temporary sanity check:
|
# FIXME: remove this temporary sanity check:
|
||||||
# this would break the assumption that admin deletion is "normal" deletion,
|
# this would break the assumption that admin deletion is "normal" deletion,
|
||||||
# which we'd like to stick to.
|
# which we'd like to stick to.
|
||||||
if cannot_be_deleted_reasons != []:
|
if len(cannot_be_deleted_reasons) > 0:
|
||||||
# This shouldn't happen: prior validation steps should have taken care of this.
|
# This shouldn't happen: prior validation steps should have taken care of this.
|
||||||
raise ValidationError({'__all__': cannot_be_deleted_reasons})
|
raise ValidationError({'__all__': cannot_be_deleted_reasons})
|
||||||
|
|
||||||
|
@ -185,7 +185,7 @@ class DeleteExtensionView(
|
|||||||
return False
|
return False
|
||||||
# Unless this extension cannot be deleted anymore
|
# Unless this extension cannot be deleted anymore
|
||||||
cannot_be_deleted_reasons = obj.cannot_be_deleted_reasons
|
cannot_be_deleted_reasons = obj.cannot_be_deleted_reasons
|
||||||
if cannot_be_deleted_reasons != []:
|
if len(cannot_be_deleted_reasons) > 0:
|
||||||
return False
|
return False
|
||||||
return True
|
return True
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user