Commit f92fbb22 authored by Jérome Perrin's avatar Jérome Perrin

fixup! py2/py3: import cStringIO from six.moves.

parent be78bb9e
from six.moves import cStringIO as StringIO from io import BytesIO
class StringIOWithFileName(StringIO): class BytesIOWithFileName(BytesIO):
filename = "{}.pdf".format( filename = "{}.pdf".format(
kw.get("title") or DateTime().strftime('%d-%m-%Y_%Hh%M')) kw.get("title") or DateTime().strftime('%d-%m-%Y_%Hh%M'))
...@@ -9,7 +9,7 @@ active_process = portal.restrictedTraverse(str(active_process_url)) ...@@ -9,7 +9,7 @@ active_process = portal.restrictedTraverse(str(active_process_url))
pdf_data_list = context.Base_getTempImageList(active_process, image_list) pdf_data_list = context.Base_getTempImageList(active_process, image_list)
pdf_data = context.ERP5Site_mergePDFList(pdf_data_list=pdf_data_list) pdf_data = context.ERP5Site_mergePDFList(pdf_data_list=pdf_data_list)
file_object = StringIOWithFileName(pdf_data) file_object = BytesIOWithFileName(pdf_data)
context.Base_contribute( context.Base_contribute(
file=file_object, file=file_object,
......
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