get principal title if person not present

git-svn-id: svn://svn.cy55.de/Zope3/src/loops/trunk@3055 fd906abe-77d9-0310-91a1-e0d9ade77398
This commit is contained in:
helmutm 2008-12-08 18:56:54 +00:00
parent 0381c7577e
commit e1a5ba9e3a

View file

@ -59,10 +59,7 @@ class BaseTrackView(TrackView):
obj = util.getObjectForUid(uid)
if obj is not None:
return obj
try:
return self.authentication.getPrincipal(uid) or uid
except PrincipalLookupError:
return uid
return uid
@Lazy
def authentication(self):
@ -71,7 +68,11 @@ class BaseTrackView(TrackView):
@Lazy
def userTitle(self):
if isinstance(self.user, basestring):
return self.user
uid = self.user
try:
return self.authentication.getPrincipal(uid).title or uid
except PrincipalLookupError:
return uid
return self.user.title
@Lazy