Don't send mail to expired members

This commit is contained in:
Yingtong Li 2020-10-04 15:13:19 +11:00
parent 802ff7343f
commit 066b461769
Signed by: RunasSudo
GPG Key ID: 7234E476BF21C61A

View File

@ -102,7 +102,7 @@ class Command(BaseCommand):
if sspromotions.models.BulletinSubscription.is_member_subscribed(member): 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) 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)) self.stdout.write('Skipping {} at {}'.format(member.id, member.email))
continue continue