diff --git a/django/contrib/admin/templates/registration/password_reset_subject.html b/django/contrib/admin/templates/registration/password_reset_subject.html
new file mode 100644
index 0000000..45a354b
-
|
+
|
|
| 1 | {% load i18n %}{% autoescape off %} |
| 2 | {% blocktrans %}Password reset on {{ site_name }}{% endblocktrans %} |
| 3 | {% endautoescape %} |
| 4 | No newline at end of file |
diff --git a/django/contrib/auth/forms.py b/django/contrib/auth/forms.py
index 55e770e..0d8c2c0 100644
a
|
b
|
class PasswordResetForm(forms.Form):
|
109 | 109 | raise forms.ValidationError(_("That e-mail address doesn't have an associated user account. Are you sure you've registered?")) |
110 | 110 | return email |
111 | 111 | |
112 | | def save(self, domain_override=None, email_template_name='registration/password_reset_email.html', |
| 112 | def save(self, domain_override=None, |
| 113 | subject_template_name='registration/password_reset_subject.html', |
| 114 | email_template_name='registration/password_reset_email.html', |
113 | 115 | use_https=False, token_generator=default_token_generator): |
114 | 116 | """ |
115 | 117 | Generates a one-use only link for resetting password and sends to the user |
… |
… |
class PasswordResetForm(forms.Form):
|
122 | 124 | domain = current_site.domain |
123 | 125 | else: |
124 | 126 | site_name = domain = domain_override |
125 | | t = loader.get_template(email_template_name) |
126 | 127 | c = { |
127 | 128 | 'email': user.email, |
128 | 129 | 'domain': domain, |
… |
… |
class PasswordResetForm(forms.Form):
|
132 | 133 | 'token': token_generator.make_token(user), |
133 | 134 | 'protocol': use_https and 'https' or 'http', |
134 | 135 | } |
135 | | send_mail(_("Password reset on %s") % site_name, |
136 | | t.render(Context(c)), None, [user.email]) |
| 136 | subject = loader.render_to_string(subject_template_name, c) |
| 137 | subject = ''.join(subject.splitlines()) |
| 138 | email = loader.render_to_string(email_template_name, c) |
| 139 | send_mail(subject, email, None, [user.email]) |
137 | 140 | |
138 | 141 | class SetPasswordForm(forms.Form): |
139 | 142 | """ |