Test alert when someone goes overdue

This commit is contained in:
Tanner Collin 2022-12-26 19:15:38 +00:00
parent e809299ca1
commit 066dcd6a30

View File

@ -104,6 +104,8 @@ def tally_membership_months(member, fake_date=None):
status = calc_member_status(expire_date, fake_date)
if member.expire_date != expire_date or member.status != status:
previous_status = member.status
member.expire_date = expire_date
member.status = status
@ -113,6 +115,11 @@ def tally_membership_months(member, fake_date=None):
alert_tanner(msg)
logger.info(msg)
if status == 'Overdue' and previous_status == 'Due':
msg = 'Member has become Overdue: {} {}'.format(member.preferred_name, member.last_name)
alert_tanner(msg)
logger.info(msg)
member.save()
logging.debug('Tallied %s membership months: updated.', member)
else: