Чтобы ответить на мой собственный вопрос, это потому, что MathCaptchaForm.clean()
был переопределен на RegistrationForm.clean()
.Я позвонил super()
изнутри RegistrationForm.clean()
, и это сработало.
Новый код в RegistrationForm.clean()
:
def clean(self):
super(RegistrationForm, self).clean()
if 'password1' in self.cleaned_data and 'password2' in self.cleaned_data:
if self.cleaned_data['password1'] != self.cleaned_data['password2']:
raise forms.ValidationError(_("The two password fields didn't match."))
return self.cleaned_data