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

This commit is contained in:
Alex Vandiver 2023-08-21 18:19:35 +00:00 committed by Tim Abbott
parent 3de007d9cd
commit adc987dc43
1 changed files with 1 additions and 1 deletions

View File

@ -559,7 +559,7 @@ def send_custom_email(
f.write(get_header(options.get("subject"), parsed_email_template.get("subject"), "subject")) f.write(get_header(options.get("subject"), parsed_email_template.get("subject"), "subject"))
# Finally, we send the actual emails. # 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: if options.get("admins_only") and not user_profile.is_realm_admin:
continue continue
context: Dict[str, Union[List[str], str]] = { context: Dict[str, Union[List[str], str]] = {