aboutsummaryrefslogtreecommitdiff
path: root/views.py
diff options
context:
space:
mode:
authorAlban Gruin2017-02-05 13:38:49 +0100
committerAlban Gruin2017-02-05 13:38:49 +0100
commit49eca350c06d9c3e2c45a1215e2d98acee0535c1 (patch)
tree474c352719bef51ed7712276b77a9343181acfa0 /views.py
parentfd3153f3fcf39eb012fa2e6dd4bcb4c45d97aeea (diff)
Correction de la semaine récupérée automatiquement dans la vue de l'emploi du temps
Diffstat (limited to 'views.py')
-rw-r--r--views.py4
1 files changed, 3 insertions, 1 deletions
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))