[Django] #12520: django.contrib.auth.forms.UserCreationForm.clean doesn't return cleaned_data dictionary

10 views
Skip to first unread message

Django

unread,
Jan 6, 2010, 1:08:58 PM1/6/10
to djang...@holovaty.com, django-...@googlegroups.com
#12520: django.contrib.auth.forms.UserCreationForm.clean doesn't return
cleaned_data dictionary
-------------------+--------------------------------------------------------
Reporter: phxx | Owner: nobody
Status: new | Milestone:
Component: Forms | Version: SVN
Keywords: | Stage: Unreviewed
Has_patch: 0 |
-------------------+--------------------------------------------------------
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.

--
Ticket URL: <http://code.djangoproject.com/ticket/12520>
Django <http://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.

Django

unread,
Jan 6, 2010, 1:09:28 PM1/6/10
to djang...@holovaty.com, django-...@googlegroups.com
#12520: django.contrib.auth.forms.UserCreationForm.clean doesn't return
cleaned_data dictionary
---------------------------------+------------------------------------------
Reporter: phxx | Owner: nobody
Status: new | Milestone:
Component: Forms | Version: SVN
Resolution: | Keywords:
Stage: Unreviewed | Has_patch: 0
Needs_docs: 0 | Needs_tests: 0
Needs_better_patch: 0 |
---------------------------------+------------------------------------------
Changes (by phxx):

* cc: gre...@muellegger.de (added)
* needs_better_patch: => 0
* needs_tests: => 0
* needs_docs: => 0

--
Ticket URL: <http://code.djangoproject.com/ticket/12520#comment:1>

Django

unread,
Jan 9, 2010, 12:06:51 AM1/9/10
to djang...@holovaty.com, django-...@googlegroups.com
#12520: django.contrib.auth.forms.UserCreationForm.clean doesn't return
cleaned_data dictionary
---------------------------------+------------------------------------------
Reporter: phxx | Owner: nobody
Status: new | Milestone:
Component: Forms | Version: SVN
Resolution: | Keywords:
Stage: Unreviewed | Has_patch: 0
Needs_docs: 0 | Needs_tests: 0
Needs_better_patch: 0 |
---------------------------------+------------------------------------------
Comment (by jasongreen):

I have the same problem..

--
Ticket URL: <http://code.djangoproject.com/ticket/12520#comment:2>

Django

unread,
Jan 11, 2010, 4:47:50 PM1/11/10
to djang...@holovaty.com, django-...@googlegroups.com
#12520: django.contrib.auth.forms.UserCreationForm.clean doesn't return
cleaned_data dictionary
---------------------------------+------------------------------------------
Reporter: phxx | Owner: nobody
Status: new | Milestone:
Component: Forms | Version: 1.2-alpha
Resolution: | Keywords:
Stage: Unreviewed | Has_patch: 0
Needs_docs: 0 | Needs_tests: 0
Needs_better_patch: 0 |
---------------------------------+------------------------------------------
Changes (by jonlesser):

* version: SVN => 1.2-alpha

Comment:

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.

--
Ticket URL: <http://code.djangoproject.com/ticket/12520#comment:3>
Reply all
Reply to author
Forward
0 new messages