aboutsummaryrefslogtreecommitdiff
path: root/views.py
diff options
context:
space:
mode:
Diffstat (limited to 'views.py')
-rw-r--r--views.py8
1 files changed, 4 insertions, 4 deletions
diff --git a/views.py b/views.py
index 363fddb..141dde8 100644
--- a/views.py
+++ b/views.py
@@ -32,9 +32,9 @@ def mention_list(request, year):
timetables = Timetable.objects.order_by("name").filter(year=year)
return render(request, "mention_list.html", {"year": year, "timetables": timetables})
-def timetables_list(request):
- timetables = Timetable.objects.order_by("name")
- groups = Group.objects.get_relevant_groups().order_by("name")
+def group_list(request, year, timetable_slug):
+ timetable = get_object_or_404(Timetable, slug=timetable_slug)
+ groups = Group.objects.get_relevant_groups(timetable=timetable).order_by("name")
year, week = get_current_week()
start, _ = get_week(year, week)
@@ -53,7 +53,7 @@ def timetables_list(request):
if hasattr(group, "weeks"):
group.weeks.sort()
- return render(request, "timetables_list.html", {"timetables": timetables, "groups": groups})
+ return render(request, "group_list.html", {"timetables": timetables, "groups": groups})
def timetable(request, timetable_slug, group_slug, year=None, week=None):
if year is None or week is None: