fix issue with setting POST attribute in request

This commit is contained in:
Mateusz Sikora 2015-11-06 14:07:12 +01:00
parent 77db2d8d64
commit 60581fc375

View File

@ -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():