fields: force base64 data as bytes (#36515)
This commit is contained in:
parent
129306e47d
commit
6c89239f3d
|
@ -1000,7 +1000,7 @@ class FileField(WidgetField):
|
|||
# b64_content key and a filename keys and an optional
|
||||
# content_type key.
|
||||
if 'b64_content' in value:
|
||||
value['content'] = base64.decodestring(value['b64_content'])
|
||||
value['content'] = base64.decodestring(force_bytes(value['b64_content']))
|
||||
if 'filename' in value and 'content' in value:
|
||||
content_type = value.get('content_type') or 'application/octet-stream'
|
||||
if content_type.startswith('text/'):
|
||||
|
|
Loading…
Reference in New Issue