|
|
|
|
@ -92,6 +92,7 @@ class RegistrationView(RegistrationViewBase): |
|
|
|
|
context = super().get_context_data(**kwargs) |
|
|
|
|
context['company_form'] = self.company_form |
|
|
|
|
context['title'] = RegistrationForm.title |
|
|
|
|
context['captcha'] = RegistrationForm.captcha |
|
|
|
|
return context |
|
|
|
|
|
|
|
|
|
def post(self, request, *args, **kwargs): |
|
|
|
|
@ -106,7 +107,9 @@ class RegistrationView(RegistrationViewBase): |
|
|
|
|
new_user = self.register(form) |
|
|
|
|
context = self.get_context_data() |
|
|
|
|
company_form = context.get('company_form') |
|
|
|
|
captcha_val = context.get('captcha') |
|
|
|
|
captcha = context.get('captcha') |
|
|
|
|
if captcha is None: |
|
|
|
|
return self.form_invalid(form=form) |
|
|
|
|
try: |
|
|
|
|
if company_form.is_valid(): |
|
|
|
|
company_form.save(user=new_user) |
|
|
|
|
|