rework statusTitleIndexer to work with reused id

This commit is contained in:
Frédéric Péters 2012-02-08 14:25:31 +01:00
parent 5cc2079c6e
commit d47c4b6576
1 changed files with 2 additions and 4 deletions

View File

@ -329,9 +329,7 @@ def statusTitleIndexer(obj):
current_state = portal_workflow.getStatusOf(
portal_workflow.getChainFor(obj)[0], obj).get('review_state')
for label, id in portal_workflow.listWFStatesByTitle():
if current_state == id:
return label
return current_state
workflow = portal_workflow.getWorkflowsFor(obj)[0]
return workflow.states[current_state].title
grok.global_adapter(statusTitleIndexer, name='statusTitle')