password-reset: Remove unnecessary template arguments.

We set these directly in the `send_email` function anyway.
This commit is contained in:
Tim Abbott
2017-10-24 11:33:06 -07:00
parent 47d14d32d4
commit b590cd6c8f
2 changed files with 7 additions and 9 deletions

View File

@@ -200,9 +200,8 @@ class ZulipPasswordResetForm(PasswordResetForm):
logging.info("Password reset attempted for %s; no active account." % (email,))
return result
def send_mail(self, subject_template_name, email_template_name,
context, from_email, to_email, html_email_template_name=None):
# type: (str, str, Dict[str, Any], str, str, str) -> None
def send_mail(self, context, from_email, to_email):
# type: (Dict[str, Any], str, str) -> None
"""
Currently we don't support accounts in multiple subdomains using
a single email address. We override this function so that we do
@@ -245,6 +244,10 @@ class ZulipPasswordResetForm(PasswordResetForm):
Generates a one-use only link for resetting password and sends to the
user.
Note: We ignore the various email template arguments (those
are an artifact of using Django's password reset framework)
"""
setattr(self, 'request', request)
email = self.cleaned_data["email"]
@@ -260,10 +263,7 @@ class ZulipPasswordResetForm(PasswordResetForm):
}
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,
)
self.send_mail(context, from_email, email)
class CreateUserForm(forms.Form):
full_name = forms.CharField(max_length=100)