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
message = str(message)\n
else:\n
message = str(error_message)\n
return context.ERP5Site_redirect(\n
\'%s/%s\' % (context.absolute_url(), form_id),\n
return context.Base_redirect(form_id,\n
keep_items={\'portal_status_message\': message}, **kw)\n
\n
portal_status_message = request.get(\'portal_status_message\', translateString(\'Status changed.\'))\n
\n
# Allow to redirect to another document\n
redirect_document_path = request.get(\'redirect_document_path\', context.getRelativeUrl())\n
redirect_document = context.restrictedTraverse(redirect_document_path)\n
redirect_document_path = request.get(\'redirect_document_path\', None)\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
return context.ERP5Site_redirect(\n
\'%s/%s\' % (redirect_document.absolute_url(), form_id),\n
return redirect_document.Base_redirect(form_id,\n
keep_items={\'portal_status_message\': portal_status_message})\n
</string> </value>
</item>
......
851
\ No newline at end of file
852
\ 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