From 6642e6f10a3d7acec278ba60c2555fa2ccf90256 Mon Sep 17 00:00:00 2001 From: demokrates Date: Wed, 21 Oct 2015 15:04:09 +0200 Subject: [PATCH 1/2] Update views.py Add submitted parameter to request (WSGI) if data are posted via JSON. Will be needed for authenticate() in "complete_signup" (if the user.backend fix will be removed in Django allauth in the future.) --- rest_auth/registration/views.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/rest_auth/registration/views.py b/rest_auth/registration/views.py index 1895267..74fbfb5 100644 --- a/rest_auth/registration/views.py +++ b/rest_auth/registration/views.py @@ -45,6 +45,13 @@ class RegisterView(APIView, SignupView): request = self.request else: request = self.request._request + # Be sure the submitted parameter stay in request.POST + # Needed for authenticate(). + if not hasattr(request, 'POST') or not request.POST: + from django.http import QueryDict + # Create mutable instance + setattr(request, 'POST', QueryDict('').copy()) + request.POST.update(self.request.POST) return complete_signup(request, self.user, app_settings.EMAIL_VERIFICATION, self.get_success_url()) From b835bb56bdcb6a40e357961bcc2051922f5bde18 Mon Sep 17 00:00:00 2001 From: demokrates Date: Wed, 21 Oct 2015 15:37:00 +0200 Subject: [PATCH 2/2] Removed trailing whitespace at comment --- rest_auth/registration/views.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/rest_auth/registration/views.py b/rest_auth/registration/views.py index 74fbfb5..f0bd0d9 100644 --- a/rest_auth/registration/views.py +++ b/rest_auth/registration/views.py @@ -45,7 +45,7 @@ class RegisterView(APIView, SignupView): request = self.request else: request = self.request._request - # Be sure the submitted parameter stay in request.POST + # Be sure the submitted parameter stay in request.POST # Needed for authenticate(). if not hasattr(request, 'POST') or not request.POST: from django.http import QueryDict