diff --git a/attachment_azure/models/ir_attachment.py b/attachment_azure/models/ir_attachment.py index c3873c6..0f265da 100644 --- a/attachment_azure/models/ir_attachment.py +++ b/attachment_azure/models/ir_attachment.py @@ -206,6 +206,8 @@ class IrAttachment(models.Model): else: container_name = None container_client = self._get_azure_container(container_name) + if not container_client: + return '' # delete the file only if it is on the current configured container # otherwise, we might delete files used on a different environment try: