Code

Opened 6 years ago

Closed 3 years ago

Last modified 3 years ago

#9213 closed (fixed)

PasswordResetForm should not reset passwords for inactive users

Reported by: john_scott 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 6 years ago.
9213.patch2 (2.8 KB) - added by fadeev 3 years ago.
added test case, refactored other tests in the same suite a bit.

Download all attachments as: .zip

Change History (11)

Changed 6 years ago by john_scott

comment:1 Changed 5 years ago by ericholscher

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

comment:2 Changed 3 years ago by anonymous

  • Owner changed from nobody to anonymous
  • Status changed from new to assigned
  • Version changed from 1.0 to 1.3-alpha

comment:3 Changed 3 years ago by anonymous

  • milestone set to 1.3

comment:4 Changed 3 years ago by lrekucki

  • Needs documentation set
  • Needs tests set

comment:5 Changed 3 years ago by jezdez

  • Component changed from Contrib apps to Authentication

Changed 3 years ago by fadeev

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

comment:6 Changed 3 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 3 years ago by carljm

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

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 3 years ago by carljm

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 3 years ago by jacob

  • milestone 1.3 deleted

Milestone 1.3 deleted

Add Comment

Modify Ticket

Change Properties
<Author field>
Action
as closed
as The resolution will be set. Next status will be 'closed'
The resolution will be deleted. Next status will be 'new'
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.