diff options
| author | Hasan Ramezani <hasan.r67@gmail.com> | 2019-11-11 10:40:04 +0100 |
|---|---|---|
| committer | Mariusz Felisiak <felisiak.mariusz@gmail.com> | 2019-11-11 10:40:04 +0100 |
| commit | 4cec3cc82a09b1a60a72e5437a7f0e9e0c7d203c (patch) | |
| tree | 82fc4a65bd241139e785e91586fa085a476c38bd /django/contrib/auth/forms.py | |
| parent | 4cb15450adac4003ed98f4adcb1710c95fd2b919 (diff) | |
Fixed #30977 -- Optimized PasswordResetForm.save() a bit.
Moved site variables assignment outside of the loop.
Diffstat (limited to 'django/contrib/auth/forms.py')
| -rw-r--r-- | django/contrib/auth/forms.py | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/django/contrib/auth/forms.py b/django/contrib/auth/forms.py index b4fb55c1b4..54e85d5a33 100644 --- a/django/contrib/auth/forms.py +++ b/django/contrib/auth/forms.py @@ -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, |
