From ddf4910f34c3c5063f0e4eb2ca05a03e14dffb63 Mon Sep 17 00:00:00 2001 From: Dominik George <nik@naturalnet.de> Date: Mon, 25 Nov 2019 00:53:51 +0100 Subject: [PATCH] Revert "Fix regression in preloading." This reverts commit 3aca4b88c878a2111f5446705cb3112ec99bffa3. --- biscuit/apps/alsijil/views.py | 14 +++----------- 1 file changed, 3 insertions(+), 11 deletions(-) diff --git a/biscuit/apps/alsijil/views.py b/biscuit/apps/alsijil/views.py index a70a43aae..44c9ed95a 100644 --- a/biscuit/apps/alsijil/views.py +++ b/biscuit/apps/alsijil/views.py @@ -97,13 +97,7 @@ def week_view(request: HttpRequest, year: Optional[int] = None, week: Optional[i lesson_period=OuterRef('pk'), week=wanted_week.week )) - ).in_week( - wanted_week - ).select_related( - 'lesson', 'lesson__subject', 'period', 'room' - ).prefetch_related( - 'lesson__groups', 'lesson__teachers', 'substitutions' - ) + ).in_week(wanted_week) group = None # FIXME workaround for #38 if request.GET.get('group', None) or request.GET.get('teacher', None) or request.GET.get('room', None): @@ -178,10 +172,8 @@ def full_register_group(request: HttpRequest, id_: int) -> HttpResponse: # Get all lesson periods for the selected group lesson_periods = LessonPeriod.objects.filter_group( group - ).distinct().select_related( - 'lesson', 'lesson__subject', 'period', 'room' - ).prefetch_related( - 'lesson__groups', 'lesson__teachers', 'substitutions', 'documentations', 'personal_notes' + ).distinct().prefetch_related( + 'documentations', 'personal_notes' ) weeks = CalendarWeek.weeks_within(group.school.current_term.date_start, group.school.current_term.date_end) -- GitLab