Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Handle an AnonymousUser being passed into is_observing correctly.

git-svn-id: https://django-notification.googlecode.com/svn/trunk@99 590c3fc9-4838-0410-bb95-17a0c9b37ca9
  • Loading branch information...
commit 87d1e5d00616d1fca013687029dc3ac71dc7e280 1 parent 2c2dc37
@brosner brosner authored
Showing with 3 additions and 0 deletions.
  1. +3 −0  notification/models.py
View
3  notification/models.py
@@ -17,6 +17,7 @@
from django.contrib.sites.models import Site
from django.contrib.auth.models import User, SiteProfileNotAvailable
+from django.contrib.auth.models import AnonymousUser
from django.contrib.contenttypes.models import ContentType
from django.contrib.contenttypes import generic
@@ -363,6 +364,8 @@ def send_observation_notices_for(observed, signal='post_save'):
return observed_items
def is_observing(observed, observer, signal='post_save'):
+ if isinstance(observer, AnonymousUser):
+ return False
try:
observed_items = ObservedItem.objects.get_for(observed, observer, signal)
return True

0 comments on commit 87d1e5d

Please sign in to comment.
Something went wrong with that request. Please try again.