From 49eca350c06d9c3e2c45a1215e2d98acee0535c1 Mon Sep 17 00:00:00 2001 From: Alban Gruin Date: Sun, 5 Feb 2017 13:38:49 +0100 Subject: Correction de la semaine récupérée automatiquement dans la vue de l'emploi du temps --- views.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/views.py b/views.py index 46c6ca7..6204d9f 100644 --- a/views.py +++ b/views.py @@ -36,7 +36,9 @@ def index(request): def timetable(request, group_slug, year=None, week=None): if year is None or week is None: - year, week, _ = timezone.now().isocalendar() + year, week, day = timezone.now().isocalendar() + if day >= 6: + year, week, _ = (timezone.now() + datetime.timedelta(weeks=1)).isocalendar() start, end = get_week(int(year), int(week)) -- cgit v1.2.1