From 3c285ce63572ebb69442a3caa10f06543d4527e5 Mon Sep 17 00:00:00 2001 From: Tanner Collin Date: Thu, 17 Mar 2022 19:55:45 +0000 Subject: [PATCH] Ignore next monthly clean from the next and last class --- apiserver/apiserver/api/utils_stats.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/apiserver/apiserver/api/utils_stats.py b/apiserver/apiserver/api/utils_stats.py index 65fba11..9f17356 100644 --- a/apiserver/apiserver/api/utils_stats.py +++ b/apiserver/apiserver/api/utils_stats.py @@ -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)