diff --git a/src/main.py b/src/main.py index 187073c..13b143b 100644 --- a/src/main.py +++ b/src/main.py @@ -202,9 +202,6 @@ def get_slot_by_id( if not event: raise HTTPException(status_code=status.HTTP_404_NOT_FOUND, detail="Slot not found") - if event.summary != TITLE_FREE: - raise HTTPException(status_code=status.HTTP_409_CONFLICT, detail="Slot is busy") - return event @@ -216,6 +213,9 @@ def mark_busy_calendar_slot_by_id( ): event = get_slot_by_id(slot_id=slot_id) + if event.summary != TITLE_FREE: + raise HTTPException(status_code=status.HTTP_409_CONFLICT, detail="Slot is busy") + event.summary = TITLE_BUSY event.colorId = COLOR_BUSY if description: