#10017 closed (fixed)
auth.forms.PasswordResetForm.clean_email returns None
Reported by: | Owned by: | Leo Shklovskii | |
---|---|---|---|
Component: | contrib.auth | Version: | dev |
Severity: | Keywords: | ||
Cc: | Triage Stage: | Accepted | |
Has patch: | yes | Needs documentation: | no |
Needs tests: | no | Patch needs improvement: | no |
Easy pickings: | no | UI/UX: | no |
Description
Classes inheriting from PasswordResetForm
will be unable to access self.cleaned_data['email']
without a stub clean_email()
to return a value:
def clean_email(self): super(MyPasswordResetForm, self).clean_email() return self.cleaned_data['email']
Attachments (2)
Change History (9)
by , 16 years ago
Attachment: | PasswordResetForm.patch added |
---|
comment:1 by , 16 years ago
Triage Stage: | Unreviewed → Accepted |
---|
comment:2 by , 16 years ago
Triage Stage: | Accepted → Ready for checkin |
---|
comment:3 by , 16 years ago
Triage Stage: | Ready for checkin → Accepted |
---|
Not ready for checkin - requires a test (django/contrib/auth/tests/forms.py). There aren't any tests for the PasswordResetForm at the moment (which is probably why this bug slipped through the cracks), but that's no excuse for not adding them when we have the chance.
comment:4 by , 16 years ago
Note that there are tests for the password reset views, and for the PasswordResetTokenGenerator, so in the tests for the PasswordResetForm the scope can be kept nice and narrow (i.e. I wouldn't worry about testing the 'save' method).
by , 16 years ago
Attachment: | 10017-tests.patch added |
---|
comment:5 by , 16 years ago
Owner: | changed from | to
---|---|
Status: | new → assigned |
I've attached several (possibly gratuitous) tests for PasswordResetForm, including one for this bug.
This would be fantastic to get checked in.
comment:6 by , 16 years ago
Resolution: | → fixed |
---|---|
Status: | assigned → closed |
Seems an obvious bug; it just caused us problems - setting to Accepted, I'd suggest this is ready for checkin?