Opened 6 years ago
Closed 6 years ago
#30977 closed Cleanup/optimization (fixed)
Moved site variables assignment outside of the loop in PasswordResetForm.save().
| Reported by: | Hasan Ramezani | Owned by: | Hasan Ramezani |
|---|---|---|---|
| Component: | contrib.auth | Version: | dev |
| Severity: | Normal | Keywords: | |
| Cc: | Triage Stage: | Accepted | |
| Has patch: | yes | Needs documentation: | no |
| Needs tests: | no | Patch needs improvement: | no |
| Easy pickings: | yes | UI/UX: | no |
Description
There is a code block for assigning the site variables in contrib.auth.forms.PasswordResetForm.save()
for user in self.get_users(email):
if not domain_override:
current_site = get_current_site(request)
site_name = current_site.name
domain = current_site.domain
else:
site_name = domain = domain_override
It would be better to move this block outside because of user is not used in this block.
Change History (4)
comment:1 by , 6 years ago
| Owner: | changed from to |
|---|---|
| Status: | new → assigned |
comment:2 by , 6 years ago
| Component: | Uncategorized → contrib.auth |
|---|---|
| Type: | Uncategorized → Cleanup/optimization |
| Version: | 2.2 → master |
comment:3 by , 6 years ago
| Summary: | Moved site variables assignment outside of the loop in contrib.auth.forms.PasswordResetForm.save() → Moved site variables assignment outside of the loop in PasswordResetForm.save(). |
|---|---|
| Triage Stage: | Unreviewed → Accepted |
Note:
See TracTickets
for help on using tickets.
PR