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:
@@ -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."))
|
||||
|
||||
Reference in New Issue
Block a user