Zulip server and web application. Open-source team chat that helps teams stay productive and focused.
minor: Avoid creating intermediate list for message_ids.
Steve Howell6ec49951c683
diff --git a/zerver/lib/export.py b/zerver/lib/export.pyindex 5f464e76799..9d3aa47108c 100644--- a/zerver/lib/export.py+++ b/zerver/lib/export.py@@ -1145,13 +1145,13 @@ def export_usermessages_batch(management command)."""with open(input_path, "rb") as input_file:output = orjson.loads(input_file.read())- message_ids = [item["id"] for item in output["zerver_message"]]+ message_ids = {item["id"] for item in output["zerver_message"]}user_profile_ids = set(output["zerver_userprofile_ids"])del output["zerver_userprofile_ids"]realm = Realm.objects.get(id=output["realm_id"])del output["realm_id"]output["zerver_usermessage"] = fetch_usermessages(- realm, set(message_ids), user_profile_ids, output_path, consent_message_id+ realm, message_ids, user_profile_ids, output_path, consent_message_id)write_message_export(output_path, output)os.unlink(input_path)