Zulip server and web application. Open-source team chat that helps teams stay productive and focused.
emoji cache: Don't join to UserProfile table.
Steve Howelle988cf9b0a45
diff --git a/zerver/models.py b/zerver/models.pyindex a9c7c6ee02a..159be1eb52a 100644--- a/zerver/models.py+++ b/zerver/models.py@@ -1166,12 +1166,8 @@ def get_realm_emoji_dicts(realm_id: int, only_active_emojis: bool = False) -> Di# of being uploaded, and we expect to be cleaned up by a# try/finally block if the upload fails, so it's correct to# exclude them.- query = (- RealmEmoji.objects.filter(realm_id=realm_id)- .exclude(- file_name=None,- )- .select_related("author")+ query = RealmEmoji.objects.filter(realm_id=realm_id).exclude(+ file_name=None,)if only_active_emojis:query = query.filter(deactivated=False)@@ -1179,9 +1175,7 @@ def get_realm_emoji_dicts(realm_id: int, only_active_emojis: bool = False) -> Difrom zerver.lib.emoji import get_emoji_urlfor realm_emoji in query.all():- author_id = None- if realm_emoji.author:- author_id = realm_emoji.author_id+ author_id = realm_emoji.author_idassert realm_emoji.file_name is not Noneemoji_url = get_emoji_url(realm_emoji.file_name, realm_emoji.realm_id)