Commit 196047a3 authored by Yusei Tahara's avatar Yusei Tahara Committed by Arnaud Fontaine

Improve error handling on Workflow_statusModify. If requested transition is...

Improve error handling on Workflow_statusModify. If requested transition is not available, then show a nice message.
parent 98f6b3bd
......@@ -52,6 +52,7 @@
<key> <string>_body</string> </key>
<value> <string encoding="cdata"><![CDATA[
from Products.CMFCore.WorkflowCore import WorkflowException\n
from Products.Formulator.Errors import FormValidationError\n
from Products.DCWorkflow.DCWorkflow import ValidationFailed\n
from Products.ERP5Type.Message import translateString\n
......@@ -118,6 +119,12 @@ except ValidationFailed, error_message:\n
# that would become an error.\n
log("Status message has been truncated")\n
message = "%s ..." % message[:(2000 - 4)]\n
except WorkflowException, error_message:\n
if str(error_message) == "No workflow provides the \'${action_id}\' action.":\n
message = translateString("Workflow state may have been updated by other user. Please try again.")\n
return context.Base_redirect(form_id, keep_items={\'portal_status_message\': message}, **kw)\n
else:\n
raise\n
else:\n
message = request.get(\'portal_status_message\')\n
if message is None:\n
......
2012-10-16 yusei
* Improve error handling on Workflow_statusModify. If requested transition is not available, then show a nice message.
2012-9-12 yusei
* Improve listbox sort feature. Now both ascending arrow and descending arrow are displayed in title column and user can sort in specific order explicitly. User also can sort multiple columns by click without using sort-on-dialog.
......
1098
\ No newline at end of file
1099
\ 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