[svn] A few registration updates

-display an error for nonmatching passwords
-display an error for short passwords
-dont direct people to http://http://sitename....
This commit is contained in:
pjrharley
2009-05-30 16:17:19 +01:00
parent b091e8eb09
commit a048adcdac
3 changed files with 7 additions and 2 deletions

View File

@@ -65,6 +65,8 @@ class RegistrationForm(forms.Form):
if 'password1' in self.cleaned_data and 'password2' in self.cleaned_data:
if self.cleaned_data['password1'] != self.cleaned_data['password2']:
raise forms.ValidationError(_(u'You must type the same password each time'))
if len(self.cleaned_data['password1']) < 6:
raise forms.ValidationError(_(u'Your password must be at least 6 characters'))
return self.cleaned_data
def save(self):