From ae61d19730f93e346012ffb60535e6d3875c5eed Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20P=C3=A9ters?= Date: Sun, 4 Dec 2011 13:06:54 +0100 Subject: [PATCH] use straight typename if missing from mapping --- tabellio/documents/document.py | 3 ++- tabellio/documents/dossier.py | 3 ++- tabellio/documents/question.py | 3 ++- 3 files changed, 6 insertions(+), 3 deletions(-) diff --git a/tabellio/documents/document.py b/tabellio/documents/document.py index 5dc46a8..fce4350 100644 --- a/tabellio/documents/document.py +++ b/tabellio/documents/document.py @@ -57,7 +57,8 @@ class Document(Item, BasePublication): @property def doctype_str(self): - return typenames.MAPPING.get(self.doctype, u'Document (%s)' % self.doctype) + if self.doctype is None: return _('Unknown') + return typenames.MAPPING.get(self.doctype, self.doctype) @property def reftitle(self): diff --git a/tabellio/documents/dossier.py b/tabellio/documents/dossier.py index 899a145..0829f59 100644 --- a/tabellio/documents/dossier.py +++ b/tabellio/documents/dossier.py @@ -179,7 +179,8 @@ class Dossier(Item, BasePublication): @property def dostype_str(self): - return typenames.MAPPING.get(self.dostype, u'Dossier (%s)' % self.dostype) + if self.dostype is None: return _('Unknown') + return typenames.MAPPING.get(self.dostype, self.dostype) @property def state_str(self): diff --git a/tabellio/documents/question.py b/tabellio/documents/question.py index 15b2acc..acc4e66 100644 --- a/tabellio/documents/question.py +++ b/tabellio/documents/question.py @@ -104,7 +104,8 @@ class Question(Item, BasePublication): @property def questype_str(self): - return typenames.MAPPING.get(self.questype, u'Question (%s)' % self.questype) + if self.questype is None: return _('Unknown') + return typenames.MAPPING.get(self.questype, self.questype) @property def state_str(self):