Commit 0938de15 authored by wenjie.zheng's avatar wenjie.zheng Committed by Sebastien Robin

WorkflowState.py: remove prefix to show the good state in workflow history.

parent 11255842
......@@ -59,7 +59,7 @@ class Getter(BaseGetter):
wf = portal_workflow.getWorkflowById(self._key)
if wf.getPortalType() in ['Workflow', 'Interaction Workflow']:
# remove id suffix for workflow and interaction workflow
return '_'.join(wf._getWorkflowStateOf(instance, id_only=1).split('_')[0:-1])
return '_'.join(wf._getWorkflowStateOf(instance, id_only=1).split('_')[1:])
else:
return wf._getWorkflowStateOf(instance, id_only=1)
......@@ -98,7 +98,7 @@ class TranslatedGetter(Getter):
portal = instance.getPortalObject()
wf = portal.portal_workflow.getWorkflowById(self._key)
if wf.getPortalType() in ['Workflow','Interaction Workflow']:
state_id = '_'.join(wf._getWorkflowStateOf(instance, id_only=1).split('_')[0:-1])
state_id = '_'.join(wf._getWorkflowStateOf(instance, id_only=1).split('_')[1:])
else:
state_id = wf._getWorkflowStateOf(instance, id_only=1)
warn('Translated workflow state getters, such as %s are deprecated' %
......
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