Skip to content

Commit

Permalink
send_custom_email: Only send emails to active remote servers.
Browse files Browse the repository at this point in the history
  • Loading branch information
eeshangarg committed Jan 21, 2022
1 parent 756dec3 commit 091e822
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions zerver/management/commands/send_custom_email.py
Original file line number Diff line number Diff line change
Expand Up @@ -90,10 +90,12 @@ def handle(self, *args: Any, **options: str) -> None:
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
Expand Down

0 comments on commit 091e822

Please sign in to comment.