Opened 7 years ago

Closed 7 years ago

Last modified 7 years ago

#10017 closed (fixed)

auth.forms.PasswordResetForm.clean_email returns None

Reported by: Zak Johnson <zakj@…> Owned by: Leo
Component: contrib.auth Version: master
Severity: Keywords:
Cc: Triage Stage: Accepted
Has patch: yes Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: UI/UX:

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@…> 7 years ago.
10017-tests.patch (1.2 KB) - added by Leo 7 years ago.

Download all attachments as: .zip

Change History (9)

Changed 7 years ago by Zak Johnson <zakj@…>

comment:1 Changed 7 years ago by glund@…

  • Needs documentation unset
  • Needs tests unset
  • Patch needs improvement unset
  • Triage Stage changed from Unreviewed to Accepted

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

comment:2 Changed 7 years ago by lukeplant

  • Triage Stage changed from Accepted to Ready for checkin

comment:3 Changed 7 years ago by russellm

  • Triage Stage changed from Ready for checkin to 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 Changed 7 years ago by lukeplant

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).

Changed 7 years ago by Leo

comment:5 Changed 7 years ago by Leo

  • Owner changed from nobody to Leo
  • Status changed from new to 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 Changed 7 years ago by lukeplant

  • Resolution set to fixed
  • Status changed from assigned to closed

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

Thanks Zak Johnson, Leo

comment:7 Changed 7 years ago by lukeplant

(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