Skip to content

Commit

Permalink
Merge PR #3026 into 16.0
Browse files Browse the repository at this point in the history
Signed-off-by bguillot
  • Loading branch information
OCA-git-bot committed Sep 11, 2024
2 parents 5881f81 + 292d9fe commit 9567287
Showing 1 changed file with 1 addition and 5 deletions.
6 changes: 1 addition & 5 deletions attachment_synchronize/models/attachment_synchronize_task.py
Original file line number Diff line number Diff line change
Expand Up @@ -211,11 +211,7 @@ def run_import(self):
with self.env.registry.cursor() as new_cr:
new_env = api.Environment(new_cr, self.env.uid, self.env.context)
file_name = file_path.split(fs.sep)[-1]
# avoid use of cat_file because it may not be implemeted in async
# implementation like sshfs
with fs.open(file_path, "rb") as fs_file:
data = fs_file.read()
data = base64.b64encode(data)
data = base64.b64encode(fs.cat_file(file_path))
attach_vals = self.with_env(new_env)._prepare_attachment_vals(
data, file_name
)
Expand Down

0 comments on commit 9567287

Please sign in to comment.