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.

email_notifications: Use assert to verify only one recipient.

Tim Abbottc98f9bcb8e1b
diff --git a/zerver/lib/email_notifications.py b/zerver/lib/email_notifications.py
index 6974d051c11..13dc0e4d5eb 100644
--- a/zerver/lib/email_notifications.py
+++ b/zerver/lib/email_notifications.py
@@ -377,10 +377,7 @@ def do_send_missedmessage_events_reply_in_zulip(
recipients = {
(msg["message"].recipient_id, msg["message"].topic_name()) for msg in missed_messages
}
- if len(recipients) != 1:
- raise ValueError(
- f"All missed_messages must have the same recipient and topic {recipients!r}",
- )
+ assert len(recipients) == 1, f"Unexpectedly multiple recipients: {recipients!r}"
# This link is no longer a part of the email, but keeping the code in case
# we find a clean way to add it back in the future