Enable digest emails for all but special-case domains.

(imported from commit 6f5c8c6c1dcd0f7ba040e86edd7b1bd41ac0dc1e)
This commit is contained in:
Jessica McKellar 2014-01-06 16:15:26 -05:00
parent b082c99267
commit 5f7c3a959e
1 changed files with 5 additions and 2 deletions

View File

@ -7,7 +7,7 @@ from django.conf import settings
from django.core.management.base import BaseCommand from django.core.management.base import BaseCommand
from zerver.lib.queue import queue_json_publish from zerver.lib.queue import queue_json_publish
from zerver.models import UserActivity, UserProfile, get_realm from zerver.models import UserActivity, UserProfile, get_realm, Realm
## Logging setup ## ## Logging setup ##
@ -90,7 +90,10 @@ in a while.
if datetime.datetime.utcnow().weekday() not in VALID_DIGEST_DAYS: if datetime.datetime.utcnow().weekday() not in VALID_DIGEST_DAYS:
return return
digest_domains = ["zulip.com"] all_domains = Realm.objects.values_list('domain', flat=True)
non_digest_domains = set(("users.customer4.invalid", "mit.edu"))
digest_domains = set(all_domains) - non_digest_domains
deployment_domains = domains_for_this_deployment() deployment_domains = domains_for_this_deployment()
for domain in digest_domains: for domain in digest_domains: