avoid error for notifications whose target has been deleted
This commit is contained in:
parent
970775f847
commit
f69a43699c
1 changed files with 3 additions and 0 deletions
|
@ -55,6 +55,7 @@ class NotificationsListing(ConceptView):
|
||||||
if self.person is None:
|
if self.person is None:
|
||||||
return []
|
return []
|
||||||
tracks = self.notifications.listTracks(unreadOnly)
|
tracks = self.notifications.listTracks(unreadOnly)
|
||||||
|
tracks = [t for t in tracks if util.getObjectForUid(t.taskId) is not None]
|
||||||
return tracks
|
return tracks
|
||||||
|
|
||||||
def getNotificationsFormatted(self):
|
def getNotificationsFormatted(self):
|
||||||
|
@ -69,6 +70,8 @@ class NotificationsListing(ConceptView):
|
||||||
sender = dict(label=s.title,
|
sender = dict(label=s.title,
|
||||||
url=self.nodeView.getUrlForTarget(baseObject(s)))
|
url=self.nodeView.getUrlForTarget(baseObject(s)))
|
||||||
obj = util.getObjectForUid(track.taskId)
|
obj = util.getObjectForUid(track.taskId)
|
||||||
|
if obj is None:
|
||||||
|
continue
|
||||||
ov = self.nodeView.getViewForTarget(obj)
|
ov = self.nodeView.getViewForTarget(obj)
|
||||||
url = '%s?form.action=notification_read&track=%s' % (
|
url = '%s?form.action=notification_read&track=%s' % (
|
||||||
self.nodeView.getUrlForTarget(obj),
|
self.nodeView.getUrlForTarget(obj),
|
||||||
|
|
Loading…
Add table
Reference in a new issue