From 066b461769a15978e6ab842eb29a7117193e2cc0 Mon Sep 17 00:00:00 2001 From: Yingtong Li Date: Sun, 4 Oct 2020 15:13:19 +1100 Subject: [PATCH] Don't send mail to expired members --- sspromotions/management/commands/sendbulletin.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sspromotions/management/commands/sendbulletin.py b/sspromotions/management/commands/sendbulletin.py index 1d41781..2dcde2d 100644 --- a/sspromotions/management/commands/sendbulletin.py +++ b/sspromotions/management/commands/sendbulletin.py @@ -102,7 +102,7 @@ class Command(BaseCommand): if sspromotions.models.BulletinSubscription.is_member_subscribed(member): template_args = sspromotions.utils.bulletin_args(member, sspromotions.models.Group.get_member_groups(member), events, bulbegin, bulend) - if len(template_args['groups']) == 0 and len(template_args['more']) == 0: + if (len(template_args['groups']) == 0 and len(template_args['more']) == 0) or member.expires < bulldt.date(): self.stdout.write('Skipping {} at {}'.format(member.id, member.email)) continue