From 28828ce73d34186287ed11c80403bf39f0c8d7ef Mon Sep 17 00:00:00 2001 From: vrenaville Date: Mon, 24 Jan 2022 15:23:40 +0100 Subject: [PATCH] fix: check if container is available to check delete --- attachment_azure/models/ir_attachment.py | 2 ++ 1 file changed, 2 insertions(+) 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: