1. Benoit Chesneau
  2. django-piston


Jesper Nøhr  committed c1dd2f6

checking for handler.anonymous in a safe way

  • Participants
  • Parent commits 7042cd3
  • Branches default

Comments (0)

Files changed (1)

File piston/resource.py

View file
         that are different (OAuth stuff in `Authorization` header.)
         if not self.authentication.is_authenticated(request):
-            if self.handler.anonymous and callable(self.handler.anonymous):
+            if hasattr(self.handler, 'anonymous') and callable(self.handler.anonymous):
                 handler = self.handler.anonymous()
                 anonymous = True