From 54986cda99dd188030ab608b88b701f395d77cf0 Mon Sep 17 00:00:00 2001 From: george Date: Sat, 6 Jun 2026 00:39:42 +0100 Subject: [PATCH] Fix sources template rendering --- tests/test_templates.py | 12 ++++++++++++ webui/app/templates/sources.html | 4 ++-- 2 files changed, 14 insertions(+), 2 deletions(-) create mode 100644 tests/test_templates.py diff --git a/tests/test_templates.py b/tests/test_templates.py new file mode 100644 index 0000000..56c7e8d --- /dev/null +++ b/tests/test_templates.py @@ -0,0 +1,12 @@ +from pathlib import Path + + +def test_templates_do_not_slice_filter_results_inline(): + template_dir = Path("webui/app/templates") + offenders = [] + for template in template_dir.glob("*.html"): + content = template.read_text() + if "| default(" in content and ")[" in content: + offenders.append(str(template)) + + assert offenders == [] diff --git a/webui/app/templates/sources.html b/webui/app/templates/sources.html index 3d50445..1c5b349 100644 --- a/webui/app/templates/sources.html +++ b/webui/app/templates/sources.html @@ -48,9 +48,9 @@ {% for src in sources %}
{{ src.library_id | default('unknown') }}
- URL: {{ src.repo_url | default('N/A')[:60] }}
+ URL: {{ src.repo_url | default('N/A') }}
Branch: {{ src.branch | default('main') }}
- Include: {{ (src.include_paths | default(['*']) | join(', ')) }} + Include: {{ src.include_paths | default(['*']) | join(', ') }}
{% endfor %}