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.

retention: Guarantee type-safeness when calling move_rows.

Zixuan James Lif0e505d557c7
diff --git a/zerver/lib/retention.py b/zerver/lib/retention.py
index 6bd1b473199..8338cdb05b9 100644
--- a/zerver/lib/retention.py
+++ b/zerver/lib/retention.py
@@ -147,8 +147,9 @@ def run_archiving_in_chunks(
new_chunk = move_rows(
Message,
query,
+ src_db_table=None,
chunk_size=Literal(chunk_size),
- returning_id=Literal(True),
+ returning_id=True,
archive_transaction_id=Literal(archive_transaction.id),
**kwargs,
)
@@ -539,7 +540,7 @@ def restore_messages_from_archive(archive_transaction_id: int) -> List[int]:
Message,
query,
src_db_table="zerver_archivedmessage",
- returning_id=Literal(True),
+ returning_id=True,
archive_transaction_id=Literal(archive_transaction_id),
)