def clean_password(self, password, user=None): if len(password) > 20: raise ValidationError( 'Please Enter a password greater that you can remember.') return DefaultAccountAdapter.clean_password(self, password)
def clean_password(self, password, user=None): if password.isdigit(): raise forms.ValidationError(('密码不能全为数字'),code = 'invalid') return DefaultAccountAdapter.clean_password(self, password, user=user)