Skip to content

Commit d93810e

Browse files
authored
Merge pull request #673 from lbedner/project-table
Project Table
2 parents 744d16f + 7cc0456 commit d93810e

2 files changed

Lines changed: 11 additions & 9 deletions

File tree

aegis/core/manual_updater.py

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -597,19 +597,21 @@ def _render_template_file(
597597
Returns:
598598
Rendered content, or None if template not found
599599
"""
600-
# Try with .jinja extension
600+
# Render .jinja templates through Jinja2.
601601
try:
602602
template = self.jinja_env.get_template(f"{template_file}{JINJA_EXTENSION}")
603603
return template.render(context)
604604
except TemplateNotFound:
605605
pass
606606

607-
# Try without extension
608-
try:
609-
template = self.jinja_env.get_template(template_file)
610-
return template.render(context)
611-
except TemplateNotFound:
612-
return None
607+
# Non-.jinja files are copied verbatim — same contract Copier uses.
608+
# Rendering them through Jinja2 breaks any source that legitimately
609+
# contains brace syntax (Python f-string {{...}} escapes, Alpine/HTMX
610+
# attributes, CSS in inline strings, etc.).
611+
raw_path = self.template_path / template_file
612+
if raw_path.is_file():
613+
return raw_path.read_text()
614+
return None
613615

614616
def install_plugin_template_tree(self, plugin_module_name: str) -> list[str]:
615617
"""Render the plugin's template tree into the project.

aegis/templates/copier-aegis-project/{{ project_slug }}/app/services/insights/collector_service.py.jinja

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -286,7 +286,7 @@ class CollectorService:
286286
current_record = max(current_record, val)
287287

288288
if record_value > current_record:
289-
desc = f"{record_value:,} ({check['label']})"
289+
desc = f"{record_value:,} ({check['label']})"
290290
event = InsightEvent(
291291
date=datetime.strptime(record_date, "%Y-%m-%d"),
292292
event_type=check["event_type"],
@@ -368,7 +368,7 @@ class CollectorService:
368368
current_record = max(current_record, val)
369369

370370
if rolling_value > current_record:
371-
desc = f"{rolling_value:,} ({check['label']})"
371+
desc = f"{rolling_value:,} ({check['label']})"
372372
event = InsightEvent(
373373
date=now,
374374
event_type=check["event_type"],

0 commit comments

Comments
 (0)