Skip to content

Commit

Permalink
superusers no longer receive all notices -- if you want to see all no…
Browse files Browse the repository at this point in the history
…tices, use admin

git-svn-id: https://django-notification.googlecode.com/svn/trunk@65 590c3fc9-4838-0410-bb95-17a0c9b37ca9
  • Loading branch information
jtauber committed Jun 15, 2008
1 parent f760d38 commit f60c9df
Showing 1 changed file with 2 additions and 8 deletions.
10 changes: 2 additions & 8 deletions notification/models.py
Expand Up @@ -2,7 +2,6 @@


from django.db import models from django.db import models
from django.conf import settings from django.conf import settings
from django.db.models import Q
from django.db.models import get_model from django.db.models import get_model
from django.core.urlresolvers import reverse from django.core.urlresolvers import reverse
from django.template.loader import render_to_string from django.template.loader import render_to_string
Expand Down Expand Up @@ -289,16 +288,11 @@ def notices_for(user, archived=False):
If archived=False, it only include notices not archived. If archived=False, it only include notices not archived.
If archived=True, it returns all notices for that user. If archived=True, it returns all notices for that user.
Superusers receive all notices.
""" """
if user.is_superuser:
q = Q()
else:
q = Q(user=user)
if archived: if archived:
return Notice.objects.filter(q) return Notice.objects.filter(user=user)
else: else:
return Notice.objects.filter(q, archived=archived) return Notice.objects.filter(user=user, archived=archived)




def unseen_count_for(user): def unseen_count_for(user):
Expand Down

0 comments on commit f60c9df

Please sign in to comment.