Commit 6a2e7d7d authored by Jérome Perrin's avatar Jérome Perrin

if redirect_document_path is set:

- no longer access context, in case the access permission has been revoked while passing transition
- redirect to /view instead of keeping form_id
also use Base_redirect instead of ERP5Site_redirect

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@30894 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent c4d229af
...@@ -119,18 +119,20 @@ except ValidationFailed, error_message:\n ...@@ -119,18 +119,20 @@ except ValidationFailed, error_message:\n
message = str(message)\n message = str(message)\n
else:\n else:\n
message = str(error_message)\n message = str(error_message)\n
return context.ERP5Site_redirect(\n return context.Base_redirect(form_id,\n
\'%s/%s\' % (context.absolute_url(), form_id),\n
keep_items={\'portal_status_message\': message}, **kw)\n keep_items={\'portal_status_message\': message}, **kw)\n
\n \n
portal_status_message = request.get(\'portal_status_message\', translateString(\'Status changed.\'))\n portal_status_message = request.get(\'portal_status_message\', translateString(\'Status changed.\'))\n
\n \n
# Allow to redirect to another document\n # Allow to redirect to another document\n
redirect_document_path = request.get(\'redirect_document_path\', context.getRelativeUrl())\n redirect_document_path = request.get(\'redirect_document_path\', None)\n
redirect_document = context.restrictedTraverse(redirect_document_path)\n if redirect_document_path:\n
redirect_document = portal.restrictedTraverse(redirect_document_path)\n
form_id = \'view\'\n
else:\n
redirect_document = context\n
\n \n
return context.ERP5Site_redirect(\n return redirect_document.Base_redirect(form_id,\n
\'%s/%s\' % (redirect_document.absolute_url(), form_id),\n
keep_items={\'portal_status_message\': portal_status_message})\n keep_items={\'portal_status_message\': portal_status_message})\n
</string> </value> </string> </value>
</item> </item>
......
851 852
\ No newline at end of file \ 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