diff --git a/account/forms.py b/account/forms.py index f70cdc5..1558bb8 100644 --- a/account/forms.py +++ b/account/forms.py @@ -92,6 +92,11 @@ class PasswordForm(forms.Form): raise forms.ValidationError( _('The new passwords were not identical.'), code='not_identical') + if len(password1) < 6: + raise forms.ValidationError( + _('Password must be at least 6 characters long'), + code='to_short') + return cleaned_data @@ -152,8 +157,12 @@ class AdminForm(forms.Form): raise forms.ValidationError( _('The new passwords were not identical.'), code='not_identical') + if len(password1) < 6: + raise forms.ValidationError( + _('Password must be at least 6 characters long'), + code='to_short') return cleaned_data def get_member_choices(self): - return [(x, x) for x in self._users] \ No newline at end of file + return [(x, x) for x in self._users]