Skip to content

Commit

Permalink
Don't print result of outage append call in jinja template (#760)
Browse files Browse the repository at this point in the history
* don't print result of append operation

* add missing raw report note
  • Loading branch information
lboeman committed Dec 3, 2021
1 parent 997e665 commit 175b9e5
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 3 deletions.
3 changes: 3 additions & 0 deletions docs/source/whatsnew/1.0.9.rst
Expand Up @@ -15,6 +15,9 @@ API Changes
:py:class:`~solarforecastarbiter.datamodel.TimePeriod` objects. For backward
compatibility, instantiating a report from existing reports without this field
results in an empty tuple.
* Added `outages` field to :py:class:`~solarforecastarbiter.datamodel.RawReport` which
reflects report outages at the time the report was computed. Defaults to an empty
tuple.
* Added optional `outages` argument to the preprocessing functions
:py:func:`~solarforecastarbiter.metrics.preprocessing.process_forecast_observations`
and
Expand Down
3 changes: 2 additions & 1 deletion solarforecastarbiter/reports/template.py
Expand Up @@ -303,7 +303,8 @@ def get_template_and_kwargs(report, dash_url, with_timeseries, body_only):
]),
autoescape=select_autoescape(['html', 'xml']),
lstrip_blocks=True,
trim_blocks=True
trim_blocks=True,
extensions=['jinja2.ext.do']
)
env.filters['pretty_json'] = _pretty_json
env.filters['figure_name_filter'] = _figure_name_filter
Expand Down
4 changes: 2 additions & 2 deletions solarforecastarbiter/reports/templates/html/body.html
Expand Up @@ -127,10 +127,10 @@ <h1 id="report-title">{{ report_name }}</h1>
{% set messages = (report.raw_report.messages | map(attribute="message") | list) + (templating_messages | default([]))%}

{% if report.outages != report.raw_report.outages %}
{{ messages.append(
{% do messages.append(
"Outages have been modified since the report was last computed. "
"Recompute to use the updated outages.")
}}
%}
{% endif %}

{% if messages | length > 0 %}
Expand Down

0 comments on commit 175b9e5

Please sign in to comment.