Reuse existing files as previews, icons or featured images #161
@ -34,7 +34,10 @@ def _delete_version_file(
|
|||||||
sender: object, instance: extensions.models.Version, **kwargs: object
|
sender: object, instance: extensions.models.Version, **kwargs: object
|
||||||
) -> None:
|
) -> None:
|
||||||
# **N.B.**: this isn't part of an overloaded `Version.delete()` method because
|
# **N.B.**: this isn't part of an overloaded `Version.delete()` method because
|
||||||
# that method isn't called when `Extension.delete()` cascades to deleting the versions.
|
# that method isn't called when `Extension.delete()` cascades to deleting the versions:
|
||||||
|
#
|
||||||
|
# delete() method for an object is not necessarily called ... as a result of a cascading delete
|
||||||
|
# https://docs.djangoproject.com/en/4.2/topics/db/models/#overriding-predefined-model-methods
|
||||||
version_file = instance.file
|
version_file = instance.file
|
||||||
logger.info('Deleting file pk=%s of Version pk=%s', version_file.pk, instance.pk)
|
logger.info('Deleting file pk=%s of Version pk=%s', version_file.pk, instance.pk)
|
||||||
version_file.delete()
|
version_file.delete()
|
||||||
|
Loading…
Reference in New Issue
Block a user