mirror of
https://github.com/camptocamp/odoo-cloud-platform.git
synced 2026-06-24 16:48:36 +00:00
[11.0] Fix connection errors when we read attachment
This commit is contained in:
committed by
Guewen Baconnier
co-authored by
Guewen Baconnier
parent
e3799cd54b
commit
8eaa15df7b
@@ -57,7 +57,13 @@ class IrAttachment(models.Model):
|
|||||||
def _store_file_read(self, fname, bin_size=False):
|
def _store_file_read(self, fname, bin_size=False):
|
||||||
if fname.startswith('swift://'):
|
if fname.startswith('swift://'):
|
||||||
swifturi = SwiftUri(fname)
|
swifturi = SwiftUri(fname)
|
||||||
|
try:
|
||||||
conn = self._get_swift_connection()
|
conn = self._get_swift_connection()
|
||||||
|
except exceptions.UserError:
|
||||||
|
_logger.exception(
|
||||||
|
"error reading attachment '%s' from object storage", fname
|
||||||
|
)
|
||||||
|
return ''
|
||||||
try:
|
try:
|
||||||
resp, obj_content = conn.get_object(swifturi.container(),
|
resp, obj_content = conn.get_object(swifturi.container(),
|
||||||
swifturi.item())
|
swifturi.item())
|
||||||
|
|||||||
Reference in New Issue
Block a user