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.
This commit is contained in:
Aditya Bansal 2018-08-18 17:48:58 +05:30 committed by Tim Abbott
parent 6893f52ad9
commit 3164f1a9a4
1 changed files with 3 additions and 3 deletions

View File

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