Commit f193c118 authored by Nicolas Delaby's avatar Nicolas Delaby

Always pass format parameter to force the download of content

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@37800 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent ccf5fe96
......@@ -58,13 +58,14 @@ response = request.RESPONSE\n
\n
from zExceptions import Unauthorized\n
\n
format = None\n
# Always force download of document even if format is supported\n
# by browser\n
file_name = context.getStandardFileName(None)\n
file_name = context.getStandardFileName(format)\n
response.setHeader(\'Content-disposition\', \'attachment; filename="%s"\' % file_name)\n
\n
try:\n
return context.index_html(request, response)\n
return context.index_html(request, response, format)\n
except Unauthorized:\n
msg = context.Base_translateString("You do not have enough permission for converting this document.")\n
return context.Base_redirect(keep_items=dict(portal_status_message=msg))\n
......@@ -110,8 +111,9 @@ except Unauthorized:\n
<string>response</string>
<string>zExceptions</string>
<string>Unauthorized</string>
<string>context</string>
<string>None</string>
<string>format</string>
<string>context</string>
<string>file_name</string>
<string>msg</string>
<string>dict</string>
......
1646
\ No newline at end of file
1650
\ No newline at end of file
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