Author: brosner
Date: Fri Sep 19 09:33:28 2008
New Revision: 99

Modified:
    trunk/notification/models.py

Log:
Handle an AnonymousUser being passed into is_observing correctly.

Modified: trunk/notification/models.py
==============================================================================
--- trunk/notification/models.py        (original)
+++ trunk/notification/models.py        Fri Sep 19 09:33:28 2008
@@ -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 @@
      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

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"pinax-updates" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/pinax-updates?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to