aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlban Gruin2017-09-27 15:06:54 +0200
committerAlban Gruin2017-09-27 15:06:54 +0200
commit436099ebef2acb8a3965cc39b07d99f61fa1eba2 (patch)
tree20e7ec165fd798c36c32f2d053743391f3cbd53c
parenta43f7fa835fcdf9f591c3f759f5ab7545c9df5b3 (diff)
Suppression des lignes trop longues
-rw-r--r--views.py11
1 files changed, 8 insertions, 3 deletions
diff --git a/views.py b/views.py
index 442ada6..404b7cb 100644
--- a/views.py
+++ b/views.py
@@ -37,11 +37,15 @@ def group_list(request, year_slug, timetable_slug):
year, week = get_current_week()
start, _ = get_week(year, week)
- groups_weeks = Course.objects.get_weeks(begin__gte=start, timetable=timetable).values("groups__mention", "groups__subgroup", "groups__td", "groups__tp", "year", "week")
+ groups_weeks = Course.objects.get_weeks(begin__gte=start, timetable=timetable) \
+ .values("groups__mention", "groups__subgroup",
+ "groups__td", "groups__tp", "year", "week")
for group in groups:
for group_week in groups_weeks:
- if group.corresponds_to(timetable.id, group_week["groups__mention"], group_week["groups__subgroup"], group_week["groups__td"], group_week["groups__tp"]):
+ if group.corresponds_to(timetable.id, group_week["groups__mention"],
+ group_week["groups__subgroup"], group_week["groups__td"],
+ group_week["groups__tp"]):
if not hasattr(group, "weeks"):
group.weeks = []
@@ -68,7 +72,8 @@ def timetable(request, year_slug, timetable_slug, group_slug, year=None, week=No
timetable = get_object_or_404(Timetable, year__slug=year_slug, slug=timetable_slug)
group = get_object_or_404(Group, slug=group_slug, timetable=timetable)
- 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) \
+ .annotate(Max("last_update"))
if courses.count() == 0:
raise Http404