From 0b7e84046f1b94b6a18635f24cfdb3ca1b1f9c78 Mon Sep 17 00:00:00 2001 From: Tony Narlock Date: Mon, 21 Apr 2014 10:14:53 -0500 Subject: [PATCH] Allow dynamicresponse to use Serialize without AuthenticationMiddleware. --- dynamicresponse/middleware/api.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dynamicresponse/middleware/api.py b/dynamicresponse/middleware/api.py index ab4d999..0bdf22b 100644 --- a/dynamicresponse/middleware/api.py +++ b/dynamicresponse/middleware/api.py @@ -62,7 +62,7 @@ def _should_authorize(self, request): already containing HTTP authorization headers. """ - if (not request.is_api) or (request.user.is_authenticated()): + if (not request.is_api) or (hasattr(request, 'user') and request.user.is_authenticated()): return False else: return self._get_auth_string(request) is not None