Merge pull request #333 from camptocamp/13_fix_delete_azure

fix: check if container is available to check delete
This commit is contained in:
Vincent Renaville
2022-01-24 15:33:03 +01:00
committed by GitHub
co-authored by GitHub
+2
View File
@@ -206,6 +206,8 @@ class IrAttachment(models.Model):
else: else:
container_name = None container_name = None
container_client = self._get_azure_container(container_name) 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 # delete the file only if it is on the current configured container
# otherwise, we might delete files used on a different environment # otherwise, we might delete files used on a different environment
try: try: