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:
parent
0381c7577e
commit
e1a5ba9e3a
1 changed files with 6 additions and 5 deletions
|
@ -59,9 +59,6 @@ class BaseTrackView(TrackView):
|
||||||
obj = util.getObjectForUid(uid)
|
obj = util.getObjectForUid(uid)
|
||||||
if obj is not None:
|
if obj is not None:
|
||||||
return obj
|
return obj
|
||||||
try:
|
|
||||||
return self.authentication.getPrincipal(uid) or uid
|
|
||||||
except PrincipalLookupError:
|
|
||||||
return uid
|
return uid
|
||||||
|
|
||||||
@Lazy
|
@Lazy
|
||||||
|
@ -71,7 +68,11 @@ class BaseTrackView(TrackView):
|
||||||
@Lazy
|
@Lazy
|
||||||
def userTitle(self):
|
def userTitle(self):
|
||||||
if isinstance(self.user, basestring):
|
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
|
return self.user.title
|
||||||
|
|
||||||
@Lazy
|
@Lazy
|
||||||
|
|
Loading…
Add table
Reference in a new issue