Commits

Jesper Nøhr  committed c1dd2f6

checking for handler.anonymous in a safe way

  • Participants
  • Parent commits 7042cd3

Comments (0)

Files changed (1)

File piston/resource.py

         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
             else: