Fixed #30977 -- Optimized PasswordResetForm.save() a bit.

Moved site variables assignment outside of the loop.
This commit is contained in:
Hasan Ramezani 2019-11-11 10:40:04 +01:00 committed by Mariusz Felisiak
parent 4cb15450ad
commit 4cec3cc82a
1 changed files with 6 additions and 6 deletions

View File

@ -286,13 +286,13 @@ class PasswordResetForm(forms.Form):
user.
"""
email = self.cleaned_data["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
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
context = {
'email': email,
'domain': domain,