Opened 16 years ago
Closed 16 years ago
#12520 closed (fixed)
django.contrib.auth.forms.UserCreationForm.clean doesn't return cleaned_data dictionary
| Reported by: | Gregor Müllegger | Owned by: | nobody |
|---|---|---|---|
| Component: | Forms | Version: | 1.2-alpha |
| Severity: | Keywords: | ||
| Cc: | gregor@… | Triage Stage: | Unreviewed |
| Has patch: | no | Needs documentation: | no |
| Needs tests: | no | Patch needs improvement: | no |
| Easy pickings: | no | UI/UX: | no |
Description
The clean() method of django.contrib.auth.forms.UserCreationForm looks like this (trunk version)
def clean(self):
# Fill the password field so model validation won't complain about it
# being blank. We'll set it with the real value below.
self.instance.password = UNUSABLE_PASSWORD
super(UserCreationForm, self).clean()
It is missing a return statement that returns the cleaned_data dictionary. Because of that the form.cleaned_data attribute will be None after validating the form.
I think this behaviour is not intended -- athorwise there would be a comment.
Change History (4)
comment:1 by , 16 years ago
| Cc: | added |
|---|
comment:2 by , 16 years ago
comment:3 by , 16 years ago
| Version: | SVN → 1.2-alpha |
|---|
I am also having this problem in r12205. The form's save() function returns the new user, so I am able to access "cleaned" data from there, but it seems cleaner to have access to cleaned data.
comment:4 by , 16 years ago
| Resolution: | → fixed |
|---|---|
| Status: | new → closed |
I have the same problem..