diff --git a/tabellio/searchform/form.py b/tabellio/searchform/form.py index f7ad29f..41f137b 100644 --- a/tabellio/searchform/form.py +++ b/tabellio/searchform/form.py @@ -27,6 +27,7 @@ from plone.registry.interfaces import IRegistry from tabellio.config.interfaces import ITabellioSettings import tabellio.config.utils +from tabellio.documents.typenames import MAPPING class ListAuthorsView(BrowserView): @@ -157,7 +158,8 @@ def possible_document_types(context): if not doctype: continue doctype_id = doctype.encode('ascii', 'replace') - terms.append(SimpleVocabulary.createTerm(doctype_id, doctype_id, doctype)) + doctype_str = MAPPING.get(doctype, doctype) + terms.append(SimpleVocabulary.createTerm(doctype_id, doctype_id, doctype_str)) return SimpleVocabulary(terms) @grok.provider(IContextSourceBinder) @@ -169,7 +171,8 @@ def possible_dossier_types(context): if not dostype: continue dostype_id = dostype.encode('ascii', 'replace') - terms.append(SimpleVocabulary.createTerm(dostype_id, dostype_id, dostype)) + dostype_str = MAPPING.get(dostype, dostype) + terms.append(SimpleVocabulary.createTerm(dostype_id, dostype_id, dostype_str)) return SimpleVocabulary(terms) @grok.provider(IContextSourceBinder) @@ -181,7 +184,8 @@ def possible_question_types(context): if not questype: continue questype_id = questype.encode('ascii', 'replace') - terms.append(SimpleVocabulary.createTerm(questype_id, questype_id, questype)) + questype_str = MAPPING.get(questype, questype) + terms.append(SimpleVocabulary.createTerm(questype_id, questype_id, questype_str)) return SimpleVocabulary(terms) @grok.provider(IContextSourceBinder)