diff --git a/biscuit/apps/alsijil/views.py b/biscuit/apps/alsijil/views.py index a70a43aae7b73a730d8811148d40a229763029bd..44c9ed95afdda1907630876395b2b96908805185 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)