Opened 8 years ago

Closed 6 years ago

Last modified 5 years ago

#9213 closed (fixed)

PasswordResetForm should not reset passwords for inactive users

Reported by: John-Scott Atlakson Owned by: anonymous
Component: contrib.auth Version: 1.3-alpha
Severity: Keywords:
Cc: Triage Stage: Accepted
Has patch: yes Needs documentation: yes
Needs tests: yes Patch needs improvement: no
Easy pickings: UI/UX:

Description

django.contrib.auth.forms.PasswordResetForm currently just validates that there is at least one User object with the form submitted email address. However, users that have been set is_active = False can still send out password reset emails to themselves, which in my email template, displays their first name. I'd rather not give the impression that I'm hanging onto their personal data, just following the Django pattern of setting the is_active flag so banned users can't sign up with the same email again. I've attached a trivial patch. Although I've stated the short summary in the affirmative, if there are good reasons not to do this check, I'm all ears.

Attachments (2)

auth_forms.diff (683 bytes) - added by John-Scott Atlakson 8 years ago.
9213.patch2 (2.8 KB) - added by fadeev 6 years ago.
added test case, refactored other tests in the same suite a bit.

Download all attachments as: .zip

Change History (11)

Changed 8 years ago by John-Scott Atlakson

Attachment: auth_forms.diff added

comment:1 Changed 8 years ago by Eric Holscher

Triage Stage: UnreviewedAccepted

comment:2 Changed 6 years ago by anonymous

Owner: changed from nobody to anonymous
Status: newassigned
Version: 1.01.3-alpha

comment:3 Changed 6 years ago by anonymous

milestone: 1.3

comment:4 Changed 6 years ago by Łukasz Rekucki

Needs documentation: set
Needs tests: set

comment:5 Changed 6 years ago by Jannis Leidel

Component: Contrib appsAuthentication

Changed 6 years ago by fadeev

Attachment: 9213.patch2 added

added test case, refactored other tests in the same suite a bit.

comment:6 Changed 6 years ago by fadeev

in 9213.patch2 there is a one liner change in ResetPasswordForm.clean_email()

a new test fails before and works after.

comment:7 Changed 6 years ago by Carl Meyer

Resolution: fixed
Status: assignedclosed

In [15805]:

Fixed #9213 - Added check to prevent inactive users from resetting their password. Thanks to John Scott for report and draft patch, and Evgeny Fadeev for final patch with test.

comment:8 Changed 6 years ago by Carl Meyer

In [15808]:

[1.2.X] Fixed #9213 - Added check to prevent inactive users from resetting their password. Thanks to John Scott for report and draft patch, and Evgeny Fadeev for final patch with test.

Backport of r15805 from trunk.

comment:9 Changed 5 years ago by Jacob

milestone: 1.3

Milestone 1.3 deleted

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