aboutsummaryrefslogtreecommitdiff
path: root/views.py
diff options
context:
space:
mode:
authorAlban Gruin2017-02-03 10:13:25 +0100
committerAlban Gruin2017-02-03 10:13:25 +0100
commitbfa5715f6deaa71ad51811bd2f59cdd330b860d9 (patch)
tree97e7fd37b44346aaec83f0df114e131aa8fa38dc /views.py
parent60cb0e3946b258deb62cbeb82a29337ac7fe2b4a (diff)
Ajout d'un lien pour voir l'emploi du temps de la semaine actuelle
Diffstat (limited to 'views.py')
-rw-r--r--views.py5
1 files changed, 4 insertions, 1 deletions
diff --git a/views.py b/views.py
index 25cf7f6..46c6ca7 100644
--- a/views.py
+++ b/views.py
@@ -34,7 +34,10 @@ def index(request):
return render(request, "index.html", {"timetables": timetables, "groups": groups})
-def timetable(request, group_slug, year, week):
+def timetable(request, group_slug, year=None, week=None):
+ if year is None or week is None:
+ year, week, _ = timezone.now().isocalendar()
+
start, end = get_week(int(year), int(week))
group = get_object_or_404(Group, slug=group_slug)