manager: remove useless timeperiods sort (#70185)

This commit is contained in:
Valentin Deniaud 2022-10-24 17:52:31 +02:00
parent aa0549f5b6
commit e716f57c36
1 changed files with 1 additions and 3 deletions

View File

@ -1332,7 +1332,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)
@ -1449,8 +1448,7 @@ class AgendaWeekMonthMixin:
return context
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)