From 1ba9082a194f60a93b8a1f52278853672254a555 Mon Sep 17 00:00:00 2001 From: Brian Wiborg Date: Sun, 24 Nov 2013 18:10:42 +0100 Subject: [PATCH] this closed #4 --- account/forms.py | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) 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]