Opened 16 years ago

Closed 16 years ago

Last modified 16 years ago

#10017 closed (fixed)

auth.forms.PasswordResetForm.clean_email returns None

Reported by: Zak Johnson <zakj@…> 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)

PasswordResetForm.patch (671 bytes ) - added by Zak Johnson <zakj@…> 16 years ago.
10017-tests.patch (1.2 KB ) - added by Leo Shklovskii 16 years ago.

Download all attachments as: .zip

Change History (9)

by Zak Johnson <zakj@…>, 16 years ago

Attachment: PasswordResetForm.patch added

comment:1 by glund@…, 16 years ago

Triage Stage: UnreviewedAccepted

Seems an obvious bug; it just caused us problems - setting to Accepted, I'd suggest this is ready for checkin?

comment:2 by Luke Plant, 16 years ago

Triage Stage: AcceptedReady for checkin

comment:3 by Russell Keith-Magee, 16 years ago

Triage Stage: Ready for checkinAccepted

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 Luke Plant, 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 Leo Shklovskii, 16 years ago

Attachment: 10017-tests.patch added

comment:5 by Leo Shklovskii, 16 years ago

Owner: changed from nobody to Leo Shklovskii
Status: newassigned

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 Luke Plant, 16 years ago

Resolution: fixed
Status: assignedclosed

(In [9906]) Fixed #10017 - PasswordResetForm.clean_email was not returning the value.

Thanks Zak Johnson, Leo

comment:7 by Luke Plant, 16 years ago

(In [9907]) [1.0.X] Fixed #10017 - PasswordResetForm.clean_email was not returning the value.

Thanks Zak Johnson, Leo

Backport of r9906 from trunk.

Note: See TracTickets for help on using tickets.
Back to Top