From 3164f1a9a4d981c1a1c0d83d895d20847197e95f Mon Sep 17 00:00:00 2001 From: Aditya Bansal Date: Sat, 18 Aug 2018 17:48:58 +0530 Subject: [PATCH] avatar: Rename user_profile to avatar_user_profile. This is a preparatory commit for upcoming changes to move /avatar/ to be a logged in or API accessible endpoint. Basically we rename this variable because the new name is more appropriate in the situation. Also user_profile will be used to hold the user_profile of person accessing the endpoint in coming up commit. --- zerver/views/users.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/zerver/views/users.py b/zerver/views/users.py index 79df5d818f..08e13f1527 100644 --- a/zerver/views/users.py +++ b/zerver/views/users.py @@ -109,11 +109,11 @@ def avatar(request: HttpRequest, email_or_id: str, medium: bool=False) -> HttpRe try: if is_email: realm = request.user.realm - user_profile = get_user_including_cross_realm(email_or_id, realm) + avatar_user_profile = get_user_including_cross_realm(email_or_id, realm) else: - user_profile = get_user_profile_by_id(email_or_id) + avatar_user_profile = get_user_profile_by_id(email_or_id) # If there is a valid user account passed in, use its avatar - url = avatar_url(user_profile, medium=medium) + url = avatar_url(avatar_user_profile, medium=medium) except UserProfile.DoesNotExist: # If there is no such user, treat it as a new gravatar email = email_or_id