From 36bae2e86cc52b441dc26610230d01b41fea4ff0 Mon Sep 17 00:00:00 2001 From: Anders Kaseorg Date: Thu, 6 Aug 2020 22:01:48 -0700 Subject: [PATCH] message_fetch: Use strings as dict keys. JSON keys must be strings, and orjson enforces this. Signed-off-by: Anders Kaseorg --- zerver/views/message_fetch.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/zerver/views/message_fetch.py b/zerver/views/message_fetch.py index ac58ab57ed..5566acf0f6 100644 --- a/zerver/views/message_fetch.py +++ b/zerver/views/message_fetch.py @@ -1146,7 +1146,8 @@ def messages_in_narrow_backend(request: HttpRequest, user_profile: UserProfile, topic_matches = row['topic_matches'] else: content_matches = topic_matches = [] - search_fields[message_id] = get_search_fields(rendered_content, topic_name, - content_matches, topic_matches) + search_fields[str(message_id)] = get_search_fields( + rendered_content, topic_name, content_matches, topic_matches, + ) return json_success({"messages": search_fields})