Make it possible to fully delete unlisted/unrated extensions #81

Merged
Anna Sirota merged 24 commits from fully-delete-extension into main 2024-04-19 11:00:19 +02:00
2 changed files with 2 additions and 2 deletions
Showing only changes of commit e98ac907f6 - Show all commits

View File

@ -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})

View File

@ -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