def clean(self): data = self.cleaned_data if data['password1'] != data['password2']: raise forms.ValidationError(("The two password fields didn't match.")) try: validations.validate_password(data['password1']) except ValidationError, err: raise forms.ValidationError, str(err)
def clean_password1(self): value = self.cleaned_data['password1'] try: validations.validate_password(value) except ValidationError, err: raise forms.ValidationError, str(err)