1
0
mirror of https://github.com/django/django.git synced 2025-10-27 07:36:08 +00:00

Fixed #7833: the user creation form now works when password1 isn't set.

git-svn-id: http://code.djangoproject.com/svn/django/trunk@8542 bcc190cf-cafb-0310-a4f2-bffc1f526a37
This commit is contained in:
Jacob Kaplan-Moss
2008-08-25 16:55:57 +00:00
parent e3df35478d
commit 15ed0d65b0
2 changed files with 33 additions and 15 deletions

View File

@@ -30,7 +30,7 @@ class UserCreationForm(forms.ModelForm):
raise forms.ValidationError(_("A user with that username already exists."))
def clean_password2(self):
password1 = self.cleaned_data["password1"]
password1 = self.cleaned_data.get("password1", "")
password2 = self.cleaned_data["password2"]
if password1 != password2:
raise forms.ValidationError(_("The two password fields didn't match."))