Ignore next monthly clean from the next and last class

This commit is contained in:
Tanner Collin 2022-03-17 19:55:45 +00:00
parent fbe61f6eec
commit 3c285ce635

View File

@ -49,8 +49,8 @@ def calc_next_events():
# TODO, go by tag?
member_meeting = sessions.filter(is_cancelled=False, course__in=[317, 413], datetime__gte=now()).first()
monthly_clean = sessions.filter(is_cancelled=False, course=273, datetime__gte=now()).first()
next_class = sessions.exclude(course__in=[317, 413]).filter(is_cancelled=False, datetime__gte=now()).order_by('datetime').first()
prev_class = sessions.exclude(course__in=[317, 413]).filter(is_cancelled=False, datetime__lte=now()).order_by('datetime').last()
next_class = sessions.exclude(course__in=[317, 413, 273]).filter(is_cancelled=False, datetime__gte=now()).order_by('datetime').first()
prev_class = sessions.exclude(course__in=[317, 413, 273]).filter(is_cancelled=False, datetime__lte=now()).order_by('datetime').last()
if member_meeting:
cache.set('next_meeting', member_meeting.datetime)