Commit 57528dc5 authored by Yoshinori Okuji's avatar Yoshinori Okuji

Explicitly convert data to a string when getting picture data, because the...

Explicitly convert data to a string when getting picture data, because the data may be Pdata, and it is not compatible with zipfile.

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@15181 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent a21035d8
...@@ -319,11 +319,12 @@ xmlns:config="http://openoffice.org/2001/config" office:version="1.0"> ...@@ -319,11 +319,12 @@ xmlns:config="http://openoffice.org/2001/config" office:version="1.0">
# manipulations are different # manipulations are different
is_standard_filetype = True is_standard_filetype = True
if not hasattr(picture,'data') or callable(picture.content_type): if getattr(picture, 'data', None) is not None \
or callable(picture.content_type):
is_standard_filetype = False is_standard_filetype = False
if is_standard_filetype: if is_standard_filetype:
picture_data = picture.data picture_data = str(picture.getData())
else: else:
picture_data = picture.Base_download() picture_data = picture.Base_download()
......
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