summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorYingtong Li <runassudo@yingtongli.me>2020-10-04 15:13:19 +1100
committerYingtong Li <runassudo@yingtongli.me>2020-10-04 15:13:19 +1100
commit066b461769a15978e6ab842eb29a7117193e2cc0 (patch)
tree8a15a47598e8ac43a2c06c9fd4a74a33c1af00a7
parent802ff7343fc886473fee5f71fbfa4f83daa3a451 (diff)
Don't send mail to expired members
-rw-r--r--sspromotions/management/commands/sendbulletin.py2
1 files changed, 1 insertions, 1 deletions
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
Contact (issues, pull requests, etc.) at git@yingtongli.me. Generated by cgit.