listing: don't fail when review_state is a callable (#6095)

This commit is contained in:
Frédéric Péters 2014-12-09 06:45:12 +01:00
parent 3aba42f602
commit 5a9f9915fe
1 changed files with 5 additions and 1 deletions

View File

@ -145,7 +145,11 @@ class InformationStateColumn(column.StateColumn):
title_mapping = {'todo': _(u'To read'),
'done': _(u'Read')
}
state_title = title_mapping[item.review_state]
if callable(item.review_state):
review_state = item.review_state()
else:
review_state = item.review_state
state_title = title_mapping[review_state]
return translate(_(state_title), context=self.request)