From ee4110721f6e2154aad6ab87d58448166dede2e9 Mon Sep 17 00:00:00 2001 From: Jesper Noehr Date: Tue, 12 May 2009 08:52:17 +0200 Subject: [PATCH] checking for handler.anonymous in a safe way --- piston/resource.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/piston/resource.py b/piston/resource.py index 73f7df4..cc466d6 100644 --- a/piston/resource.py +++ b/piston/resource.py @@ -63,7 +63,7 @@ class Resource(object): 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: