mirror of
https://github.com/camptocamp/odoo-cloud-platform.git
synced 2026-06-23 18:04:34 +00:00
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:
co-authored by
GitHub
parent
6f9d5a2e5e
commit
171b83f497
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user