summaryrefslogtreecommitdiff
path: root/django/contrib/auth/forms.py
diff options
context:
space:
mode:
authorNick Pope <nick.pope@flightdataservices.com>2017-12-11 12:08:45 +0000
committerTim Graham <timograham@gmail.com>2017-12-11 07:08:45 -0500
commitd13a9e44ded4e93570c6ba42ec84e45ddca2505b (patch)
tree0df16e6538d8794c39bd62b5a46879b8abe6572c /django/contrib/auth/forms.py
parenta9e5ac823df8ba8b786b6450c967ca378c008d0e (diff)
Fixed #28909 -- Simplified code using tuple/list/set/dict unpacking.
Diffstat (limited to 'django/contrib/auth/forms.py')
-rw-r--r--django/contrib/auth/forms.py8
1 files changed, 4 insertions, 4 deletions
diff --git a/django/contrib/auth/forms.py b/django/contrib/auth/forms.py
index 18fca67439..e857f95cb2 100644
--- a/django/contrib/auth/forms.py
+++ b/django/contrib/auth/forms.py
@@ -299,9 +299,8 @@ class PasswordResetForm(forms.Form):
'user': user,
'token': token_generator.make_token(user),
'protocol': 'https' if use_https else 'http',
+ **(extra_email_context or {}),
}
- if extra_email_context is not None:
- context.update(extra_email_context)
self.send_mail(
subject_template_name, email_template_name, context, from_email,
email, html_email_template_name=html_email_template_name,
@@ -357,9 +356,10 @@ class PasswordChangeForm(SetPasswordForm):
A form that lets a user change their password by entering their old
password.
"""
- error_messages = dict(SetPasswordForm.error_messages, **{
+ error_messages = {
+ **SetPasswordForm.error_messages,
'password_incorrect': _("Your old password was entered incorrectly. Please enter it again."),
- })
+ }
old_password = forms.CharField(
label=_("Old password"),
strip=False,