Fix "received a naive datetime" warning

This commit is contained in:
Tanner Collin 2023-05-12 17:27:27 +00:00
parent 7bd1c9f175
commit 62d122d414

View File

@ -643,7 +643,7 @@ class CourseDetailSerializer(serializers.ModelSerializer):
raise raise
def course_is_usually_monthly(course): def course_is_usually_monthly(course):
two_months_ago = utils.today_alberta_tz() - datetime.timedelta(days=61) two_months_ago = utils.now_alberta_tz() - datetime.timedelta(days=61)
recent_sessions = obj.sessions.filter(datetime__gte=two_months_ago) recent_sessions = obj.sessions.filter(datetime__gte=two_months_ago)
if recent_sessions.count() < 3: if recent_sessions.count() < 3:
return True return True