Zulip server and web application. Open-source team chat that helps teams stay productive and focused.
import_realm: Don't re-generate jdenticon avatar for the whole server.
Mateusz Mandera5d510f06a492
diff --git a/zerver/lib/import_realm.py b/zerver/lib/import_realm.pyindex 7c87b22cc1a..0f090da87bb 100644--- a/zerver/lib/import_realm.py+++ b/zerver/lib/import_realm.py@@ -1905,7 +1905,9 @@ def do_import_realm(import_dir: Path, subdomain: str, processes: int = 1) -> Rea# is deterministically generated using a combination of user ID and realm UUID# as input value. Since user ID possibly changes on import, the resulting# Jdenticon would differ. We regenerate it here using the current user ID.- for user_profile in UserProfile.objects.filter(avatar_source=UserProfile.AVATAR_FROM_JDENTICON):+ for user_profile in UserProfile.objects.filter(+ avatar_source=UserProfile.AVATAR_FROM_JDENTICON, realm=realm+ ):generate_and_upload_jdenticon_avatar(user_profile, str(realm.uuid), future=False)# We need to have this check as the emoji files may not