From a112a9a7065babece294f7a7fb6b1e9abdda89b8 Mon Sep 17 00:00:00 2001 From: quaduzi Date: Fri, 30 Jun 2023 14:20:12 +0700 Subject: [PATCH] =?UTF-8?q?=D0=9F=D0=B5=D1=80=D0=B5=D0=BD=D0=B5=D1=81=20?= =?UTF-8?q?=D0=BE=D1=88=D0=B8=D0=B1=D0=BA=D1=83=20=D0=BE=20=D0=B7=D0=B0?= =?UTF-8?q?=D0=BD=D1=8F=D1=82=D0=BE=D0=BC=20=D1=81=D0=BB=D0=BE=D1=82=D0=B5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/main.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) 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: