use straight typename if missing from mapping

This commit is contained in:
Frédéric Péters 2011-12-04 13:06:54 +01:00
parent dcd2d2bf4a
commit ae61d19730
3 changed files with 6 additions and 3 deletions

View File

@ -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):

View File

@ -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):

View File

@ -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):