mirror of
https://github.com/camptocamp/odoo-cloud-platform.git
synced 2026-06-24 08:47:40 +00:00
azure_attachment: handle no container client
This commit is contained in:
@@ -173,6 +173,8 @@ class IrAttachment(models.Model):
|
|||||||
location = self.env.context.get("storage_location") or self._storage()
|
location = self.env.context.get("storage_location") or self._storage()
|
||||||
if location == "azure":
|
if location == "azure":
|
||||||
container_client = self._get_azure_container()
|
container_client = self._get_azure_container()
|
||||||
|
if not container_client:
|
||||||
|
return ""
|
||||||
filename = "azure://%s/%s" % (container_client.container_name, key)
|
filename = "azure://%s/%s" % (container_client.container_name, key)
|
||||||
with io.BytesIO() as file:
|
with io.BytesIO() as file:
|
||||||
blob_client = container_client.get_blob_client(key.lower())
|
blob_client = container_client.get_blob_client(key.lower())
|
||||||
|
|||||||
Reference in New Issue
Block a user