mirror of
https://github.com/django/django.git
synced 2025-10-26 23:26:08 +00:00
Permit custom from-email address in auth forms email.
Patch from cassidy and Rob Hudson. Fixed #11300. git-svn-id: http://code.djangoproject.com/svn/django/trunk@13817 bcc190cf-cafb-0310-a4f2-bffc1f526a37
This commit is contained in:
@@ -117,7 +117,7 @@ class PasswordResetForm(forms.Form):
|
||||
return email
|
||||
|
||||
def save(self, domain_override=None, email_template_name='registration/password_reset_email.html',
|
||||
use_https=False, token_generator=default_token_generator):
|
||||
use_https=False, token_generator=default_token_generator, from_email=None):
|
||||
"""
|
||||
Generates a one-use only link for resetting password and sends to the user
|
||||
"""
|
||||
@@ -140,7 +140,7 @@ class PasswordResetForm(forms.Form):
|
||||
'protocol': use_https and 'https' or 'http',
|
||||
}
|
||||
send_mail(_("Password reset on %s") % site_name,
|
||||
t.render(Context(c)), None, [user.email])
|
||||
t.render(Context(c)), from_email, [user.email])
|
||||
|
||||
class SetPasswordForm(forms.Form):
|
||||
"""
|
||||
|
||||
Reference in New Issue
Block a user