aboutsummaryrefslogtreecommitdiff
path: root/views.py
diff options
context:
space:
mode:
Diffstat (limited to 'views.py')
-rw-r--r--views.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/views.py b/views.py
index 10dcfa2..9b53f3a 100644
--- a/views.py
+++ b/views.py
@@ -15,7 +15,7 @@
import datetime
-from django.db.models import Count, Max
+from django.db.models import Max
from django.db.models.functions import ExtractWeek, ExtractYear, Length
from django.http import Http404
from django.shortcuts import get_object_or_404, render
@@ -39,11 +39,11 @@ def mention_list(request, year_slug):
def group_list(request, year_slug, timetable_slug):
timetable = get_object_or_404(Timetable, year__slug=year_slug, slug=timetable_slug)
- groups = Group.objects.filter(source=timetable.source, hidden=False).order_by("name")
start, _ = get_week(*get_current_week())
end = start + datetime.timedelta(weeks=4)
+ groups = Group.objects.get_relevant_groups(start, source=timetable.source, hidden=False)
groups_weeks = Course.objects.get_weeks(begin__gte=start, begin__lt=end, groups__in=groups)
for group in groups: