summaryrefslogtreecommitdiffstats
path: root/src/collective/contact/widget/source.py
diff options
context:
space:
mode:
Diffstat (limited to 'src/collective/contact/widget/source.py')
-rw-r--r--src/collective/contact/widget/source.py11
1 files changed, 9 insertions, 2 deletions
diff --git a/src/collective/contact/widget/source.py b/src/collective/contact/widget/source.py
index dc7d58e..dc6dc6f 100644
--- a/src/collective/contact/widget/source.py
+++ b/src/collective/contact/widget/source.py
@@ -62,8 +62,15 @@ class ContactSource(ObjPathSource):
value = brain._unrestrictedGetObject()
else:
value = brain.getPath()[len(self.portal_path):]
- full_title = brain.get_full_title or brain.Title or brain.id
- return Term(value, token=brain.getPath(), title=full_title.decode('utf8'), brain=brain)
+ if brain.get_full_title:
+ full_title = brain.get_full_title
+ elif type(brain.Title) is unicode:
+ full_title = brain.Title
+ elif brain.Title:
+ full_title = unicode(brain.Title, 'utf-8')
+ else:
+ full_title = unicode(brain.id)
+ return Term(value, token=brain.getPath(), title=full_title, brain=brain)
def tokenToPath(self, token):
"""For token='/Plone/a/b', return '/a/b'