Skip to content

armgit / zulip

Public Imported from GitHub
0

Zulip server and web application. Open-source team chat that helps teams stay productive and focused.

export: Remove unnecessary if in export with consent code.

Mateusz Manderae360b5e29b15
diff --git a/zerver/lib/export.py b/zerver/lib/export.py
index 3a3371983e6..2092aff260f 100644
--- a/zerver/lib/export.py
+++ b/zerver/lib/export.py
@@ -1266,6 +1266,8 @@ def export_partial_message_files(
messages_we_received,
]
else:
+ message_queries = []
+
# We capture most messages here: Messages that were sent by
# anyone in the export and received by any of the users who we
# have consent to export.
@@ -1273,6 +1275,7 @@ def export_partial_message_files(
sender__in=ids_of_our_possible_senders,
recipient__in=recipient_ids_for_us,
)
+ message_queries.append(messages_we_received)
if consent_message_id is not None:
# Export with member consent requires some careful handling to make sure
@@ -1292,6 +1295,8 @@ def export_partial_message_files(
has_usermessage=True,
)
+ message_queries.append(messages_we_received_in_protected_history_streams)
+
# The above query is missing some messages that consenting
# users have access to, namely, PMs sent by one of the users
# in our export to another user (since the only subscriber to
@@ -1311,12 +1316,7 @@ def export_partial_message_files(
recipient__in=recipient_ids_for_them,
)
- message_queries = [
- messages_we_received,
- messages_we_sent_to_them,
- ]
- if consent_message_id is not None:
- message_queries.append(messages_we_received_in_protected_history_streams)
+ message_queries.append(messages_we_sent_to_them)
all_message_ids: Set[int] = set()