links: Flatten the set into a list before serializing into the queue.

orjson does not transparently do this set-to-list translation, unlike
ujson.
This commit is contained in:
Alex Vandiver 2020-08-11 23:46:00 -07:00 committed by Tim Abbott
parent 63173d5554
commit 153f16ee6a
2 changed files with 2 additions and 2 deletions

View File

@ -1618,7 +1618,7 @@ def do_send_messages(messages_maybe_none: Sequence[Optional[MutableMapping[str,
'message_id': message['message'].id,
'message_content': message['message'].content,
'message_realm_id': message['realm'].id,
'urls': links_for_embed}
'urls': list(links_for_embed)}
queue_json_publish('embed_links', event_data)
if message['message'].recipient.type == Recipient.PERSONAL:

View File

@ -223,7 +223,7 @@ def update_message_backend(request: HttpRequest, user_profile: UserMessage,
# `sender.realm_id` must match the decision made in the
# `render_incoming_message` call earlier in this function.
'message_realm_id': user_profile.realm_id,
'urls': links_for_embed}
'urls': list(links_for_embed)}
queue_json_publish('embed_links', event_data)
return json_success()