emails: Change reset password emails to use to_user_id.

This commit is contained in:
Rishi Gupta
2017-07-10 20:11:08 -07:00
committed by Tim Abbott
parent 154d37afd2
commit 3d24d12ba1
2 changed files with 4 additions and 4 deletions

View File

@@ -213,13 +213,13 @@ class ZulipPasswordResetForm(PasswordResetForm):
the mail through the functions in zerver.lib.send_email, to match
how we send all other mail in the codebase.
"""
user_realm = get_user_profile_by_email(to_email).realm
user = get_user_profile_by_email(to_email)
attempted_subdomain = get_subdomain(getattr(self, 'request'))
context['attempted_realm'] = False
if not check_subdomain(user_realm.subdomain, attempted_subdomain):
if not check_subdomain(user.realm.subdomain, attempted_subdomain):
context['attempted_realm'] = get_realm(attempted_subdomain)
send_email('zerver/emails/password_reset', to_email=to_email,
send_email('zerver/emails/password_reset', to_user_id=user.id,
from_name="Zulip Account Security",
from_address=FromAddress.NOREPLY, context=context)

View File

@@ -61,6 +61,6 @@ class Command(ZulipBaseCommand):
}
logging.warning("Sending %s email to %s" % (email_template_name, user_profile.email,))
send_email('zerver/emails/password_reset', to_email=user_profile.email,
send_email('zerver/emails/password_reset', to_user_id=user_profile.id,
from_name="Zulip Account Security", from_address=FromAddress.NOREPLY,
context=context)