diff --git a/eshop/accounts_ext/forms.py b/eshop/accounts_ext/forms.py index 70d866a..f3aaf43 100644 --- a/eshop/accounts_ext/forms.py +++ b/eshop/accounts_ext/forms.py @@ -56,6 +56,11 @@ class RegistrationForm(RegistrationFormUniqueEmail): raise forms.ValidationError(_('Введите email с валидными доменом')) return email + def clean(self): + if not self.cleaned_data['captcha']: + raise forms.ValidationError(_("Проверьте правильности капчи")) + return self.cleaned_data + def save(self, commit=True): user = super().save(commit) profile = Profile.objects.filter(user=user).first()