From 2f38bc669fb0884e321beb809c08f05c80bfdb65 Mon Sep 17 00:00:00 2001 From: Mateusz Mandera Date: Sat, 18 Jan 2020 14:03:30 +0100 Subject: [PATCH] auth: Set request._email to user.delivery_email instead of user.email. In other places where we set request._email, we set it to the delivery_email, as that's more informative in orgs with hidden email settings, where user.email will be useless. --- zerver/views/auth.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/zerver/views/auth.py b/zerver/views/auth.py index 444e80c43c..dee683b4f5 100644 --- a/zerver/views/auth.py +++ b/zerver/views/auth.py @@ -240,7 +240,7 @@ def login_or_register_remote_user(request: HttpRequest, remote_username: str, # Mark this request as having a logged-in user for our server logs. process_client(request, user_profile) - request._email = user_profile.email + request._email = user_profile.delivery_email return response @@ -805,7 +805,7 @@ def api_fetch_api_key(request: HttpRequest, username: str=REQ(), password: str=R # Mark this request as having a logged-in user for our server logs. process_client(request, user_profile) - request._email = user_profile.email + request._email = user_profile.delivery_email api_key = get_api_key(user_profile) return json_success({"api_key": api_key, "email": user_profile.delivery_email})