mirror of
https://github.com/zulip/zulip.git
synced 2025-11-03 13:33:24 +00:00
emails: Change reset password emails to use to_user_id.
This commit is contained in:
@@ -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)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user