From 72b10e406b94c2d60f01cb22b171cdabc5f7affa Mon Sep 17 00:00:00 2001 From: Valentin Deniaud Date: Mon, 24 Oct 2022 17:52:31 +0200 Subject: [PATCH 5/7] manager: remove useless timeperiods sort (#70185) --- chrono/manager/views.py | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/chrono/manager/views.py b/chrono/manager/views.py index 19aa5621..0cbb314b 100644 --- a/chrono/manager/views.py +++ b/chrono/manager/views.py @@ -1250,7 +1250,6 @@ class AgendaDayView(AgendaDateView, DayArchiveView): if t.weekday == self.date.weekday() and (not t.weekday_indexes or get_weekday_index(self.date) in t.weekday_indexes) ] - timeperiods = sorted(timeperiods, key=lambda t: t.start_time) interval = datetime.timedelta(minutes=60) @@ -1388,8 +1387,7 @@ class AgendaMonthView(AgendaDateView, MonthArchiveView): return '1' def get_timetable_infos(self): - timeperiods = itertools.chain(*(d.timeperiod_set.all() for d in self.agenda.prefetched_desks)) - timeperiods = sorted(timeperiods, key=lambda t: (t.weekday, t.start_time)) + timeperiods = list(itertools.chain(*(d.timeperiod_set.all() for d in self.agenda.prefetched_desks))) interval = datetime.timedelta(minutes=60) -- 2.35.1