Fix 'min' undefined error in /files view by adding min/max to Jinja2 globals

Co-authored-by: christianlouis <361235+christianlouis@users.noreply.github.com>
This commit is contained in:
copilot-swe-agent[bot]
2026-02-07 15:35:54 +00:00
parent 850139d3f8
commit f3ce81a6cf
2 changed files with 73 additions and 0 deletions
+4
View File
@@ -15,6 +15,10 @@ from app.config import settings
templates_dir = Path(__file__).parent.parent.parent / "frontend" / "templates"
templates = Jinja2Templates(directory=str(templates_dir))
# Add Python built-in functions to Jinja2 template globals
templates.env.globals["min"] = min
templates.env.globals["max"] = max
# Customize Jinja2Templates to include app_version in all templates
original_template_response = templates.TemplateResponse