Permalink
Browse files

limit notifications query so it's possible to use OccupyWallSt login

  • Loading branch information...
1 parent 79dc331 commit 61b98ee1d6afbff45398345811c6502fbbfb7f2a Justine Tunney committed Jan 7, 2012
Showing with 5 additions and 5 deletions.
  1. +5 −5 occupywallst/context_processors.py
View
10 occupywallst/context_processors.py
@@ -38,10 +38,10 @@ def goodies(request):
def notifications(request):
- if request.user.is_authenticated():
- qset = (request.user.notification_set
- .filter(is_read=False)
- .order_by('published'))
+ if request.user and request.user.is_authenticated():
+ qset = (db.Notification.objects
+ .filter(user=request.user, is_read=False)
+ .order_by('published'))[:15]
return {'notifications': qset}
else:
- return {}
+ return {'notifications': []}

0 comments on commit 61b98ee

Please sign in to comment.