aboutsummaryrefslogtreecommitdiff
path: root/views.py
diff options
context:
space:
mode:
Diffstat (limited to 'views.py')
-rw-r--r--views.py6
1 files changed, 3 insertions, 3 deletions
diff --git a/views.py b/views.py
index c549cfb..e883e9d 100644
--- a/views.py
+++ b/views.py
@@ -18,15 +18,15 @@ def index(request):
current_year, current_week, _ = timezone.now().isocalendar()
start, _ = get_week(current_year, current_week)
- groups_weeks = Course.objects.get_weeks(start)
+ groups_weeks = Course.objects.get_weeks(begin__gte=start).values("groups__timetable", "groups__mention", "groups__subgroup", "groups__td", "groups__tp", "year", "week")
for group in groups:
for group_week in groups_weeks:
- if group.corresponds_to(group_week.timetable_id, group_week.mention, group_week.subgroup, group_week.td, group_week.tp):
+ if group.corresponds_to(group_week["groups__timetable"], group_week["groups__mention"], group_week["groups__subgroup"], group_week["groups__td"], group_week["groups__tp"]):
if not hasattr(group, "weeks"):
group.weeks = []
- date, _ = get_week(group_week.year, group_week.week)
+ date, _ = get_week(group_week["year"], group_week["week"])
if date not in group.weeks:
group.weeks.append(date)