From 60581fc3750026d7267586a6253a72c420ba573b Mon Sep 17 00:00:00 2001 From: Mateusz Sikora Date: Fri, 6 Nov 2015 14:07:12 +0100 Subject: [PATCH] fix issue with setting POST attribute in request --- rest_auth/registration/views.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/rest_auth/registration/views.py b/rest_auth/registration/views.py index 1895267..ec4cebd 100644 --- a/rest_auth/registration/views.py +++ b/rest_auth/registration/views.py @@ -49,9 +49,13 @@ class RegisterView(APIView, SignupView): app_settings.EMAIL_VERIFICATION, self.get_success_url()) + def get_form_kwargs(self, *args, **kwargs): + kwargs = super(RegisterView, self).get_form_kwargs(*args, **kwargs) + kwargs['data'] = self.request.data + return kwargs + def post(self, request, *args, **kwargs): self.initial = {} - self.request.POST = self.request.data.copy() form_class = self.get_form_class() self.form = self.get_form(form_class) if self.form.is_valid():