diff --git a/app/main.py b/app/main.py index e5e3b06..2a0003b 100644 --- a/app/main.py +++ b/app/main.py @@ -48,17 +48,20 @@ app.mount("/static", StaticFiles(directory="static"), name="static") templates = Jinja2Templates(directory="templates") +#@app.get("/") +#async def root(request: Request) -> HTMLResponse: +# return templates.TemplateResponse( +# request=request, name="landing.html" +# ) + + @app.get("/") -async def root(request: Request) -> HTMLResponse: - return templates.TemplateResponse( - request=request, name="landing.html" - ) - - -@app.get("/vote") -async def vote(request: Request, session_id: str, unordered: bool = False, user = Security(get_current_user, scopes=[]), +async def vote(request: Request, session_id: str | None = None , unordered: bool = False, user=Security(get_current_user, scopes=[]), db: Session = Depends(get_db)) -> HTMLResponse: + if not session_id: + session_id = user["sub"] + print(user) veto_mode = get_setting(db, "veto_mode")