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(