notification: avoid error because of user without person
This commit is contained in:
parent
5c90a19859
commit
357c660659
2 changed files with 7 additions and 3 deletions
|
@ -63,8 +63,11 @@ class NotificationsListing(ConceptView):
|
|||
for track in self.getNotifications(unreadOnly):
|
||||
data = track.data
|
||||
s = util.getObjectForUid(data.get('sender'))
|
||||
sender = dict(label=s.title,
|
||||
url=self.nodeView.getUrlForTarget(baseObject(s)))
|
||||
if s is None:
|
||||
sender = dict(label=u'???', url=u'')
|
||||
else:
|
||||
sender = dict(label=s.title,
|
||||
url=self.nodeView.getUrlForTarget(baseObject(s)))
|
||||
obj = util.getObjectForUid(track.taskId)
|
||||
ov = self.nodeView.getViewForTarget(obj)
|
||||
url = '%s?form.action=notification_read&track=%s' % (
|
||||
|
|
|
@ -86,7 +86,8 @@
|
|||
<tr tal:repeat="notif item/getNotificationsFormatted">
|
||||
<td tal:content="notif/timeStamp" />
|
||||
<td tal:define="sender notif/sender">
|
||||
<a tal:attributes="href sender/url"
|
||||
<a tal:omit-tag="not:sender/url"
|
||||
tal:attributes="href sender/url"
|
||||
tal:content="sender/label" /></td>
|
||||
<td tal:define="object notif/object">
|
||||
<a tal:attributes="href object/url"
|
||||
|
|
Loading…
Add table
Reference in a new issue