Remove the bin_size return (#366)

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-05-02 10:47:31 +02:00
committed by GitHub
co-authored by GitHub
parent 6f9d5a2e5e
commit 171b83f497
+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)