From 0592c59174bfb2cbb2b96f62297963c9a6c1bb60 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Sat, 14 Mar 2026 09:07:17 +0000 Subject: [PATCH] fix(ui): add missing suggested_languages global to error templates The error templates (404.html, 500.html) extend base.html which uses {{ suggested_languages | tojson }} in the language selector dropdown. The _error_templates instance in app/main.py was missing this global, causing Jinja2 Undefined objects to be passed to the tojson filter, resulting in "TypeError: Object of type Undefined is not JSON serializable" errors in 35 tests. Co-authored-by: christianlouis <361235+christianlouis@users.noreply.github.com> --- app/main.py | 1 + 1 file changed, 1 insertion(+) diff --git a/app/main.py b/app/main.py index 6089699b..72b0155c 100644 --- a/app/main.py +++ b/app/main.py @@ -267,6 +267,7 @@ _error_templates.env.globals["_"] = lambda key, **kwargs: _translate_fn(key, "en _error_templates.env.globals["min"] = min _error_templates.env.globals["max"] = max _error_templates.env.globals["supported_languages"] = _SUPPORTED_LANGUAGES +_error_templates.env.globals["suggested_languages"] = [] @app.exception_handler(HTTPException)