diff options
author | Alban Gruin | 2017-10-10 18:07:54 +0200 |
---|---|---|
committer | Alban Gruin | 2017-10-10 18:07:54 +0200 |
commit | e6ccfea46083c4cd228be57565be006e8c3c59f8 (patch) | |
tree | 667b9b0116cc7d48bdef8c8c619466d07617d2c8 /views.py | |
parent | 72dcae5c9d58005af71b293d1ec09a4c50335c64 (diff) |
Correction de l’affichage de la dernière mise à jour
Diffstat (limited to 'views.py')
-rw-r--r-- | views.py | 6 |
1 files changed, 3 insertions, 3 deletions
@@ -80,15 +80,15 @@ def timetable(request, year_slug, timetable_slug, group_slug, year=None, week=No if group.children.count(): return group_list_common(request, timetable, Group.objects.get_relevant_children(group)) - courses = Course.objects.get_courses_for_group(group, begin__gte=start, begin__lt=end) \ - .annotate(Max("last_update")) + courses = Course.objects.get_courses_for_group(group, begin__gte=start, begin__lt=end) if courses.count() == 0: raise Http404 + last_update = courses.aggregate(Max("last_update")) grouped_courses = group_courses(courses) return render(request, "timetable.html", {"group": group, "courses": grouped_courses, - "last_update": courses.first().last_update__max, + "last_update": last_update["last_update__max"], "year": year, "week": int(week), "is_old_timetable": is_old_timetable}) |