Commit c2d7e7f4 authored by Elouan Martinet's avatar Elouan Martinet
Browse files

[storages] Refactor upload code

parent b32b817810c1
......@@ -62,10 +62,11 @@ class S3Storage(Storage):
binary = entity.cw_edited.pop(attr)
if binary is not None:
key = self.get_s3_key(entity, attr)
# bytes storage used to store S3's object key
binary_obj = Binary(key.encode('utf-8'))
entity.cw_edited.edited_attribute(attr, binary_obj)
# required workaround for boto3 bug
# save S3 key
attr, Binary(key.encode('utf-8')))
# copy Binary value, workaround for boto3 bug
# .read() is required since Binary can't wrap itself
buffer = Binary(
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment