fix: use request-first TemplateResponse signature

Modern Starlette requires `request` as the first positional arg to
TemplateResponse. The old `TemplateResponse(name, context)` form caused
the context dict to be passed as the template name, which Jinja2 then
tried to use as a cache key -> TypeError: unhashable type: 'dict' (500
on GET / and /roster).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-06-08 17:59:39 +00:00
parent 450509d210
commit e3f9ca7f5b
+2 -2
View File
@@ -76,12 +76,12 @@ app.include_router(routers.router)
@app.get("/", response_class=HTMLResponse) @app.get("/", response_class=HTMLResponse)
def index(request: Request): def index(request: Request):
return templates.TemplateResponse("index.html", {"request": request}) return templates.TemplateResponse(request, "index.html")
@app.get("/roster", response_class=HTMLResponse) @app.get("/roster", response_class=HTMLResponse)
def roster(request: Request): def roster(request: Request):
return templates.TemplateResponse("roster.html", {"request": request}) return templates.TemplateResponse(request, "roster.html")
@app.get("/health") @app.get("/health")