diff --git a/browser/auth.py b/browser/auth.py index 972eb36..7b9d084 100644 --- a/browser/auth.py +++ b/browser/auth.py @@ -20,6 +20,7 @@ Login, logout, unauthorized stuff. """ +from zope.app.exception.browser.unauthorized import Unauthorized as DefaultUnauth from zope.app.security.interfaces import IAuthentication from zope.app.security.interfaces import ILogout, IUnauthenticatedPrincipal from zope import component @@ -87,5 +88,8 @@ class Unauthorized(ConceptView): response.setHeader('Expires', 'Mon, 26 Jul 1997 05:00:00 GMT') response.setHeader('Cache-Control', 'no-store, no-cache, must-revalidate') response.setHeader('Pragma', 'no-cache') + if self.nodeView is None: + v = DefaultUnauth(self.context, self.request) + return v() url = self.nodeView.topMenu.url response.redirect(url + '/unauthorized') diff --git a/organize/personal/browser/notification.py b/organize/personal/browser/notification.py index cbc7674..17bb00a 100644 --- a/organize/personal/browser/notification.py +++ b/organize/personal/browser/notification.py @@ -25,6 +25,7 @@ from zope.app.pagetemplate import ViewPageTemplateFile from zope.cachedescriptors.property import Lazy from loops.browser.concept import ConceptView +from loops.organize.personal.notification import Notifications from loops.organize.party import getPersonForUser from loops import util @@ -42,3 +43,10 @@ class NotificationsListing(ConceptView): def person(self): return getPersonForUser(self.context, self.request) + @Lazy + def notifications(self): + return Notifications(self.person) + + def getNotifications(self, unreadOnly=True): + tracks = self.notifications.listTracks() + return tracks diff --git a/organize/personal/browser/personal_macros.pt b/organize/personal/browser/personal_macros.pt index 77e7a1f..108acdd 100644 --- a/organize/personal/browser/personal_macros.pt +++ b/organize/personal/browser/personal_macros.pt @@ -58,6 +58,10 @@