From 072a56a870984d69efd856a00ad825edc8012fb9 Mon Sep 17 00:00:00 2001 From: geeknux Date: Mon, 6 Jul 2015 19:12:31 +0430 Subject: [PATCH] bugfix for wrong user unread notification count --- notifications/templatetags/notifications_tags.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/notifications/templatetags/notifications_tags.py b/notifications/templatetags/notifications_tags.py index 8aeac45..7deca04 100644 --- a/notifications/templatetags/notifications_tags.py +++ b/notifications/templatetags/notifications_tags.py @@ -9,8 +9,10 @@ register = Library() def notifications_unread(context): if 'user' not in context: return '' - - user = context['user'] + + request = context['request'] + user = request.user if user.is_anonymous(): return '' - return user.notifications.unread().count() \ No newline at end of file + return user.notifications.unread().count() +