api: handle empty opening hours after removing exceptions (#43126)
This commit is contained in:
parent
fc2108bbb5
commit
7973059dcb
|
@ -122,6 +122,11 @@ def get_all_slots(agenda, meeting_type, unique=False):
|
|||
for desk, desk_exception in desks_exceptions.items():
|
||||
base = IntervalSet([agenda_id_min_max_datetime[desk.agenda_id]])
|
||||
base = base - desk_exception
|
||||
if not base:
|
||||
# ignore this desk, exceptions cover all opening time
|
||||
# use an empty interval (begin == end) for this
|
||||
desk_min_max_datetime[desk] = (base_min_datetime, base_min_datetime)
|
||||
continue
|
||||
min_datetime = base.min().replace(hour=0, minute=0, second=0, microsecond=0)
|
||||
max_datetime = base.max()
|
||||
start_of_day = max_datetime.replace(hour=0, minute=0, second=0, microsecond=0)
|
||||
|
|
Loading…
Reference in New Issue