From 56781ffb1e90ee3fac457e2900f1086ced28584c Mon Sep 17 00:00:00 2001 From: rrr-marble Date: Wed, 20 Dec 2023 12:13:31 +0000 Subject: [PATCH] add: ignore more input validation errors --- backend/src/main.py | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/backend/src/main.py b/backend/src/main.py index 4412323..f35a958 100644 --- a/backend/src/main.py +++ b/backend/src/main.py @@ -190,18 +190,18 @@ def create_items( ), ) - # construct a list of schemas.Item items - spreadsheet_item_list = [ - schemas.ItemCreate( - **{ - key: row[i] - for i, key in enumerate(schemas.ItemCreate.__fields__.keys()) - } - ) - for row in sheet["data"] - ] - # dump all the data into database try: + # construct a list of schemas.Item items + spreadsheet_item_list = [ + schemas.ItemCreate( + **{ + key: row[i] + for i, key in enumerate(schemas.ItemCreate.__fields__.keys()) + } + ) + for row in sheet["data"] + ] + # dump all the data into database accepted, processed = crud.insert_items(db=db, items=spreadsheet_item_list) except Exception as e: raise HTTPException(