From b654d23e97c0f08170ad4b9a6e6ac1f0083ad280 Mon Sep 17 00:00:00 2001 From: Timur Enikeev Date: Mon, 16 Sep 2024 16:20:56 -0400 Subject: [PATCH] Fix unique events dict get fix --- calendar_backend/routes/event/event.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/calendar_backend/routes/event/event.py b/calendar_backend/routes/event/event.py index 9db62bc..a8dba34 100644 --- a/calendar_backend/routes/event/event.py +++ b/calendar_backend/routes/event/event.py @@ -110,9 +110,9 @@ async def create_events( event_dict = event.model_dump() existing_events_query = ( Event.get_all(session=db.session) - .filter(Event.name == event_dict["name"]) - .filter(Event.start_ts == event_dict["start_ts"]) - .filter(Event.end_ts == event_dict["end_ts"]) + .filter(Event.name == event_dict.get("name")) + .filter(Event.start_ts == event_dict.get("start_ts")) + .filter(Event.end_ts == event_dict.get("end_ts")) ) is_unique = True for existing_event in existing_events_query.all():