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 9ca3f87614 by Guewen
Baconnier
This commit is contained in:
Alexandre Fayolle
2022-04-29 10:07:43 +02:00
parent 6f9d5a2e5e
commit 4acfcd22a2
+1 -4
View File
@@ -164,10 +164,7 @@ class IrAttachment(models.Model):
return '' return ''
try: try:
blob_client = container_client.get_blob_client(key) blob_client = container_client.get_blob_client(key)
if bin_size: read = base64.b64encode(blob_client.download_blob().readall())
return blob_client.get_blob_properties()['size']
else:
read = base64.b64encode(blob_client.download_blob().readall())
except HttpResponseError: except HttpResponseError:
read = "" read = ""
_logger.info("Attachment '%s' missing on object storage", fname) _logger.info("Attachment '%s' missing on object storage", fname)