mirror of
https://github.com/camptocamp/odoo-cloud-platform.git
synced 2026-06-24 08:47:40 +00:00
[12.0][IMP] attachment_azure: don't get blob content if we only need its size
This commit is contained in:
@@ -150,6 +150,9 @@ class IrAttachment(models.Model):
|
|||||||
key = fname.replace("azure://", "", 1).lower()
|
key = fname.replace("azure://", "", 1).lower()
|
||||||
try:
|
try:
|
||||||
blob_client = container_client.get_blob_client(key)
|
blob_client = container_client.get_blob_client(key)
|
||||||
|
if bin_size:
|
||||||
|
return blob_client.get_blob_properties()['size']
|
||||||
|
else:
|
||||||
read = base64.b64encode(blob_client.download_blob().readall())
|
read = base64.b64encode(blob_client.download_blob().readall())
|
||||||
except HttpResponseError:
|
except HttpResponseError:
|
||||||
read = ""
|
read = ""
|
||||||
|
|||||||
Reference in New Issue
Block a user