mirror of
https://github.com/Tivix/django-rest-auth.git
synced 2025-04-22 01:32:08 +03:00
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.)
This commit is contained in:
parent
ba5edbaf62
commit
6642e6f10a
|
@ -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())
|
||||
|
|
Loading…
Reference in New Issue
Block a user