diff --git a/src/clear_bookings.py b/src/clear_bookings.py index 5d2fab7..0374d07 100644 --- a/src/clear_bookings.py +++ b/src/clear_bookings.py @@ -439,7 +439,8 @@ def find_overlapping_events(events: list[DavEvent]) -> dict: for event in events: # Skip if the event is already in the overlapping events dictionary - if overlapping_events.get(event.extended_uid): + # or if it is already canceled + if overlapping_events.get(event.extended_uid) or event.is_cancelled: continue for compare_event in events: @@ -449,8 +450,9 @@ def find_overlapping_events(events: list[DavEvent]) -> dict: continue # Skip if the compare_event is already in the overlapping events - # dictionary - if overlapping_events.get(compare_event.extended_uid): + # dictionary or if it is already canceled + if (overlapping_events.get(compare_event.extended_uid) + or compare_event.is_cancelled): continue # Check if the events overlap