Commit 5a20f582 authored by Jérome Perrin's avatar Jérome Perrin

deferred_style: encode data in bz2, zlib can overflow

parent 4845d50a
No related merge requests found
......@@ -77,7 +77,7 @@ with portal.Localizer.translationContext(localizer_language):\n
\n
report_section.popReport(portal, render_prefix=render_prefix)\n
\n
return report_section_idx, data.encode(\'utf8\').encode(\'zlib\')\n
return report_section_idx, data.encode(\'utf8\').encode(\'bz2\')\n
</string> </value>
</item>
<item>
......
......@@ -68,10 +68,17 @@ with portal.Localizer.translationContext(localizer_language):\n
\n
def dummyReportMethod():\n
return report_section_list\n
\n
def decodeReportSection(data):\n
# BBB We use to encode in zlib\n
try:\n
return data.decode(\'bz2\')\n
except IOError:\n
return data.decode(\'zlib\')\n
\n
report_data = context.restrictedTraverse(form_path).report_view.pt_render(\n
extra_context=dict(options={\'format\': format},\n
rendered_report_item_list=(r[1].decode(\'zlib\') for r in report_section_list),\n
rendered_report_item_list=(decodeReportSection(r[1]) for r in report_section_list),\n
report_method=dummyReportMethod,\n
form=portal.restrictedTraverse(form_path)))\n
\n
......
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