From 4acfcd22a2391d35268a04a18113b0ebb055c86f Mon Sep 17 00:00:00 2001 From: Alexandre Fayolle Date: Fri, 29 Apr 2022 10:07:43 +0200 Subject: [PATCH] Remove the bin_size return When we return a bin_size (such as 28672), the web client does not accept it as as bin size and try to use it as value for the b64 src of the image. Though, returning the image as b64 in all cases does seem to be supported. This comes from 9ca3f876149028242cc43ef334af4e4746b2f5d0 by Guewen Baconnier --- attachment_azure/models/ir_attachment.py | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/attachment_azure/models/ir_attachment.py b/attachment_azure/models/ir_attachment.py index 301900b..c58e818 100644 --- a/attachment_azure/models/ir_attachment.py +++ b/attachment_azure/models/ir_attachment.py @@ -164,10 +164,7 @@ class IrAttachment(models.Model): return '' 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()) + read = base64.b64encode(blob_client.download_blob().readall()) except HttpResponseError: read = "" _logger.info("Attachment '%s' missing on object storage", fname)