From 7321a632f1cc44432993e00b50d9b5db7205efef Mon Sep 17 00:00:00 2001 From: FUNNYDMAN Date: Mon, 12 Nov 2018 09:55:48 +0300 Subject: [PATCH] fix problem with captcha binding --- eshop/accounts_ext/forms.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/eshop/accounts_ext/forms.py b/eshop/accounts_ext/forms.py index 70d866a..1c29a67 100644 --- a/eshop/accounts_ext/forms.py +++ b/eshop/accounts_ext/forms.py @@ -56,6 +56,13 @@ class RegistrationForm(RegistrationFormUniqueEmail): raise forms.ValidationError(_('Введите email с валидными доменом')) return email + def clean_captcha(self): + captcha = super().clean_captcha() + if not captcha: + raise forms.ValidationError("Enter captcha") + print(captcha) + return captcha + def save(self, commit=True): user = super().save(commit) profile = Profile.objects.filter(user=user).first()