message_edit: Output a list, not a reversed iterator.

A list_reverseiterator object is not JSON serializable, and orjson
enforces this.

Signed-off-by: Anders Kaseorg <anders@zulip.com>
This commit is contained in:
Anders Kaseorg 2020-08-06 21:52:22 -07:00 committed by Tim Abbott
parent 03d2540899
commit 114b0a2982
1 changed files with 1 additions and 1 deletions

View File

@ -90,7 +90,7 @@ def get_message_edit_history(request: HttpRequest, user_profile: UserProfile,
# Fill in all the extra data that will make it usable
fill_edit_history_entries(message_edit_history, message)
return json_success({"message_history": reversed(message_edit_history)})
return json_success({"message_history": list(reversed(message_edit_history))})
PROPAGATE_MODE_VALUES = ["change_later", "change_one", "change_all"]
@has_request_variables