add checking for captcha

remotes/origin/ESHOP_fix_problem_with_registration
FUNNYDMAN 7 years ago
parent a19a96eac6
commit 20f706acaa
  1. 5
      eshop/accounts_ext/forms.py

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

Loading…
Cancel
Save