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_custom_email: Only send emails to active remote servers.

Eeshan Garg93329c2d70e0
diff --git a/zerver/management/commands/send_custom_email.py b/zerver/management/commands/send_custom_email.py
index af5131dfd7d..5a07383556d 100644
--- a/zerver/management/commands/send_custom_email.py
+++ b/zerver/management/commands/send_custom_email.py
@@ -90,10 +90,12 @@ class Command(ZulipBaseCommand):
elif options["remote_servers"]:
from zilencer.models import RemoteZulipServer
- # TODO: Make this filter for deactivated=False once we add
- # that to the data model.
target_emails = list(
- set(RemoteZulipServer.objects.all().values_list("contact_email", flat=True))
+ set(
+ RemoteZulipServer.objects.filter(deactivated=False).values_list(
+ "contact_email", flat=True
+ )
+ )
)
elif options["all_sponsored_org_admins"]:
# Sends at most one copy to each email address, even if it