mirror of
https://github.com/Hopiu/django-notifications.git
synced 2026-04-15 02:40:58 +00:00
Merge pull request #68 from Geeknux/master
bugfix for wrong user unread notification count
This commit is contained in:
commit
8efaea86e7
1 changed files with 5 additions and 3 deletions
|
|
@ -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()
|
||||
return user.notifications.unread().count()
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue