portico: Load medium-sized avatar in preview.

This commit is to use medium-size avatar images when previewing avatars during the copy account settings flow. Before this commit, the avatar images were blurry when using the avatar from an existing account while joining a new realm. Now, the avatar is clear.

Fixes #32604.
This commit is contained in:
Jenna Jaehnig
2024-12-07 15:15:10 -05:00
committed by Tim Abbott
parent 83a121c7e4
commit 0f59e2e788
2 changed files with 3 additions and 2 deletions

View File

@@ -487,12 +487,13 @@ def get_accounts_for_email(email: str) -> list[Account]:
) )
.order_by("date_joined") .order_by("date_joined")
) )
return [ return [
dict( dict(
realm_name=profile.realm.name, realm_name=profile.realm.name,
realm_id=profile.realm.id, realm_id=profile.realm.id,
full_name=profile.full_name, full_name=profile.full_name,
avatar=avatar_url(profile), avatar=avatar_url(profile, medium=True),
) )
for profile in profiles for profile in profiles
] ]

View File

@@ -1471,7 +1471,7 @@ class UserProfileTest(ZulipTestCase):
for account in accounts: for account in accounts:
realm = user.realm realm = user.realm
if ( if (
account["avatar"] == avatar_url(user) account["avatar"] == avatar_url(user, medium=True)
and account["full_name"] == user.full_name and account["full_name"] == user.full_name
and account["realm_name"] == realm.name and account["realm_name"] == realm.name
and account["realm_id"] == realm.id and account["realm_id"] == realm.id