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.

send_email: Use a consistent order when sending custom emails to users.

Alex Vandiveradc987dc43f6
diff --git a/zerver/lib/send_email.py b/zerver/lib/send_email.py
index c904de3696a..a55add60484 100644
--- a/zerver/lib/send_email.py
+++ b/zerver/lib/send_email.py
@@ -559,7 +559,7 @@ def send_custom_email(
f.write(get_header(options.get("subject"), parsed_email_template.get("subject"), "subject"))
# Finally, we send the actual emails.
- for user_profile in users.select_related("realm"):
+ for user_profile in users.select_related("realm").order_by("id"):
if options.get("admins_only") and not user_profile.is_realm_admin:
continue
context: Dict[str, Union[List[str], str]] = {