From d47c4b6576148c0383450750c5fcc1a5fa93667c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20P=C3=A9ters?= Date: Wed, 8 Feb 2012 14:25:31 +0100 Subject: [PATCH] rework statusTitleIndexer to work with reused id --- themis/search/indexer.py | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/themis/search/indexer.py b/themis/search/indexer.py index 25d0ec7..abdb934 100644 --- a/themis/search/indexer.py +++ b/themis/search/indexer.py @@ -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')