From 8d382e5fa2107398d8793483674d50d768cd3029 Mon Sep 17 00:00:00 2001 From: Alban Gruin Date: Sun, 12 Feb 2017 13:30:55 +0100 Subject: Erreur 404 au lieu de 500 si une semaine n'est pas trouvée --- views.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/views.py b/views.py index c573589..651533a 100644 --- a/views.py +++ b/views.py @@ -59,8 +59,8 @@ def timetable(request, timetable_slug, group_slug, year=None, week=None): timetable = get_object_or_404(Timetable, slug=timetable_slug) group = get_object_or_404(Group, slug=group_slug, timetable=timetable) + last_update = get_object_or_404(LastUpdate, timetable=timetable, week=week, year=year) courses = Course.objects.get_courses_for_group(group, begin__gte=start, begin__lt=end) - last_update = LastUpdate.objects.get(timetable=timetable, week=week, year=year) grouped_courses = group_courses(courses) -- cgit v1.2.1