Avoid crash when flight.co2_kg is not set.

This commit is contained in:
Edward Betts 2026-02-18 17:09:18 +00:00
parent 84dfafefa1
commit 2edfb40e66

View file

@ -497,7 +497,7 @@ https://www.flightradar24.com/data/flights/{{ flight.airline_detail.iata | lower
<span class="text-nowrap"><strong>duration:</strong> {{ flight.duration }}</span>
{% endif %}
{# <pre>{{ flight | pprint }}</pre> #}
{% if flight.co2_kg is not none %}
{% if flight.co2_kg is defined and flight.co2_kg is not none %}
<span class="text-nowrap"><strong>CO₂:</strong> {{ "{:,.1f}".format(flight.co2_kg) }} kg</span>
{% endif %}
{% endif %}