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>
This commit is contained in:
copilot-swe-agent[bot]
2026-03-14 09:07:17 +00:00
parent ac5495134b
commit 0592c59174
+1
View File
@@ -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)