[12.0][IMP] attachment_azure: don't get blob content if we only need its size

This commit is contained in:
Nils Hamerlinck
2021-10-20 22:26:51 +07:00
parent d874ae7386
commit 297c8072ef
+3
View File
@@ -150,6 +150,9 @@ class IrAttachment(models.Model):
key = fname.replace("azure://", "", 1).lower()
try:
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())
except HttpResponseError:
read = ""