Filter out cancelled meetings and cleanups

This commit is contained in:
Tanner Collin 2020-03-29 02:30:34 +00:00
parent 9fb122aed4
commit 3a9fd875b2

View File

@ -25,8 +25,8 @@ def changed_card():
def calc_next_events(): def calc_next_events():
sessions = models.Session.objects sessions = models.Session.objects
member_meeting = sessions.filter(course=317, datetime__gte=now()).first() member_meeting = sessions.filter(is_cancelled=False, course=317, datetime__gte=now()).first()
monthly_clean = sessions.filter(course=273, datetime__gte=now()).first() monthly_clean = sessions.filter(is_cancelled=False, course=273, datetime__gte=now()).first()
if member_meeting: if member_meeting:
cache.set('next_meeting', member_meeting.datetime) cache.set('next_meeting', member_meeting.datetime)