From e3f9ca7f5b64b320b2b8b2529f8b2e38fe071c20 Mon Sep 17 00:00:00 2001 From: serversdown Date: Mon, 8 Jun 2026 17:59:39 +0000 Subject: [PATCH] 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) --- app/main.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/main.py b/app/main.py index ffce6a2..4db5847 100644 --- a/app/main.py +++ b/app/main.py @@ -76,12 +76,12 @@ app.include_router(routers.router) @app.get("/", response_class=HTMLResponse) def index(request: Request): - return templates.TemplateResponse("index.html", {"request": request}) + return templates.TemplateResponse(request, "index.html") @app.get("/roster", response_class=HTMLResponse) def roster(request: Request): - return templates.TemplateResponse("roster.html", {"request": request}) + return templates.TemplateResponse(request, "roster.html") @app.get("/health")