Перенес ошибку о занятом слоте

This commit is contained in:
quaduzi 2023-06-30 14:20:12 +07:00
parent ed54a0aa71
commit a112a9a706
1 changed files with 3 additions and 3 deletions

View File

@ -202,9 +202,6 @@ def get_slot_by_id(
if not event: if not event:
raise HTTPException(status_code=status.HTTP_404_NOT_FOUND, detail="Slot not found") 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 return event
@ -216,6 +213,9 @@ def mark_busy_calendar_slot_by_id(
): ):
event = get_slot_by_id(slot_id=slot_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.summary = TITLE_BUSY
event.colorId = COLOR_BUSY event.colorId = COLOR_BUSY
if description: if description: