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.
This commit is contained in:
Mateusz Mandera 2020-01-18 14:03:30 +01:00 committed by Tim Abbott
parent 030c07184a
commit 2f38bc669f
1 changed files with 2 additions and 2 deletions

View File

@ -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})