clan_cli: Added automated database population. Fixed incorrect error handling in backend

This commit is contained in:
2023-12-09 18:57:20 +01:00
parent 80269832e6
commit a93e6019c5
9 changed files with 102 additions and 54 deletions

View File

@@ -35,10 +35,11 @@ def setup_app() -> FastAPI:
# bind sql engine
# TODO comment aut and add flag to run with pupulated data rm *.sql run pytest with marked then start clan webui
# https://docs.pytest.org/en/7.1.x/example/markers.html
sql_models.Base.metadata.drop_all(engine)
# sql_models.Base.metadata.drop_all(engine)
sql_models.Base.metadata.create_all(bind=engine)
app = FastAPI(lifespan=lifespan)
app = FastAPI(lifespan=lifespan, swagger_ui_parameters={"tryItOutEnabled": True})
app.add_middleware(
CORSMiddleware,
allow_origins=origins,