Skip to content

Commit

Permalink
Move request.DATA into condition
Browse files Browse the repository at this point in the history
Not sure why this was producing the following error:
`AssertionError: {u'detail': u'JSON parse error - No JSON object could be decoded'}`
  • Loading branch information
Kevin Etienne committed Apr 17, 2015
1 parent 678c974 commit cbd151c
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions user_management/api/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -313,8 +313,8 @@ def initial(self, request, *args, **kwargs):
Set user as a class attribute or raise an `InvalidExpiredToken`.
"""
email = request.DATA.get('email')
if request.user.is_authenticated() and email != request.user.email:
user = request.user
if user.is_authenticated() and request.DATA.get('email') != user.email:

This comment has been minimized.

Copy link
@kevinetienne

kevinetienne Apr 17, 2015

Contributor

Not sure why moving request.DATA in the condition after user.is_authenticated() doesn't raise the following error https://travis-ci.org/incuna/django-user-management/jobs/58881526

raise PermissionDenied()

return super(ResendConfirmationEmail, self).initial(
Expand Down

0 comments on commit cbd151c

Please sign in to comment.