-
-class UserPasswordForm(forms.Form):
-
- new_password = forms.CharField(widget=forms.PasswordInput(),
- label=_("Your new password"))
- verifier = forms.CharField(widget=forms.PasswordInput(),
- label=_("Repeated password"))
-
- def clean(self):
- if 'verifier' not in self.cleaned_data or 'new_password' not in self.cleaned_data:
- return self.cleaned_data
-
- if self.cleaned_data['verifier'] != self.cleaned_data['new_password']:
- raise forms.ValidationError(_("Passwords do not match!"))
-
- return self.cleaned_data