diff --git a/themis/fields/vocabs.py b/themis/fields/vocabs.py index fd8037b..d1cdeec 100644 --- a/themis/fields/vocabs.py +++ b/themis/fields/vocabs.py @@ -341,9 +341,14 @@ class RelatedDocObjPathSource(ObjPathSource): value = brain._unrestrictedGetObject() else: value = brain.getPath()[len(self.portal_path):] - return SimpleTerm(value, token=brain.getPath(), title=u'%s [%s]' % ( - unicode(brain.Title, 'utf-8'), - brain.getObject().Type())) + if type(brain.Title) is unicode: + title = brain.Title + else: + title = unicode(brain.Title, 'utf-8') + return SimpleTerm(value, token=brain.getPath(), title=u'%s [%s]' % ( + title.replace('\n', ' - ').replace('\r', ''), + brain.Type)) + class RelatedDocObjPathSourceBinder(ObjPathSourceBinder): path_source = RelatedDocObjPathSource