mirror of
https://github.com/camptocamp/odoo-cloud-platform.git
synced 2026-06-24 16:48:36 +00:00
Merge commit 'refs/pull/174/head' of github.com:camptocamp/odoo-cloud-platform into merge-branch-2543-bssmb-362-fix_set_acl_with_prod_dump_in_dev-dd4cd51b
This commit is contained in:
@@ -122,7 +122,9 @@ class IrAttachment(models.Model):
|
||||
bucket.meta.client.head_object(
|
||||
Bucket=bucket.name, Key=key
|
||||
)
|
||||
res = io.BytesIO()
|
||||
if bin_size:
|
||||
return bucket.Object(key).content_length
|
||||
with io.BytesIO() as res:
|
||||
bucket.download_fileobj(key, res)
|
||||
res.seek(0)
|
||||
read = base64.b64encode(res.read())
|
||||
@@ -141,7 +143,7 @@ class IrAttachment(models.Model):
|
||||
if location == 's3':
|
||||
bucket = self._get_s3_bucket()
|
||||
obj = bucket.Object(key=key)
|
||||
file = io.BytesIO()
|
||||
with io.BytesIO() as file:
|
||||
file.write(bin_data)
|
||||
file.seek(0)
|
||||
filename = 's3://%s/%s' % (bucket.name, key)
|
||||
|
||||
Reference in New Issue
Block a user