AttributeError: 'DummyUser' object has no attribute 'is_authenticated' #9

Closed
kumar303 opened this Issue Sep 30, 2015 · 0 comments

Comments

Projects
None yet
1 participant
@kumar303
Owner

kumar303 commented Sep 30, 2015

As of version 0.0.6 if you have rest_framework.permissions.IsAuthenticated in your permission classes, you'll see the following traceback:

web_1 | Traceback (most recent call last):
web_1 |   File "/usr/local/lib/python2.7/site-packages/django/core/handlers/base.py", line 132, in get_response
web_1 |     response = wrapped_callback(request, *callback_args, **callback_kwargs)
web_1 |   File "/usr/local/lib/python2.7/site-packages/django/views/decorators/csrf.py", line 58, in wrapped_view
web_1 |     return view_func(*args, **kwargs)
web_1 |   File "/usr/local/lib/python2.7/site-packages/django/views/generic/base.py", line 71, in view
web_1 |     return self.dispatch(request, *args, **kwargs)
web_1 |   File "/usr/local/lib/python2.7/site-packages/rest_framework/views.py", line 466, in dispatch
web_1 |     response = self.handle_exception(exc)
web_1 |   File "/usr/local/lib/python2.7/site-packages/rest_framework/views.py", line 454, in dispatch
web_1 |     self.initial(request, *args, **kwargs)
web_1 |   File "/usr/local/lib/python2.7/site-packages/rest_framework/views.py", line 377, in initial
web_1 |     self.check_permissions(request)
web_1 |   File "/usr/local/lib/python2.7/site-packages/rest_framework/views.py", line 318, in check_permissions
web_1 |     if not permission.has_permission(request, self):
web_1 |   File "/usr/local/lib/python2.7/site-packages/rest_framework/permissions.py", line 48, in has_permission
web_1 |     return request.user and request.user.is_authenticated()
web_1 | AttributeError: 'DummyUser' object has no attribute 'is_authenticated'

kumar303 added a commit that referenced this issue Sep 30, 2015

Returns a real-ish auth user (fixes #9)
This was fallout from the 0.0.6 release which fixed the auth implementation for supporting non-hawk requests.

@kumar303 kumar303 closed this in 648734d Sep 30, 2015

kumar303 added a commit that referenced this issue Sep 30, 2015

Merge pull request #10 from kumar303/fix-auth
Returns a real-ish auth user (fixes #9)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment