Avoid crash when flight.co2_kg is not set.
This commit is contained in:
parent
84dfafefa1
commit
2edfb40e66
1 changed files with 1 additions and 1 deletions
|
|
@ -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>
|
<span class="text-nowrap"><strong>duration:</strong> {{ flight.duration }}</span>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
{# <pre>{{ flight | pprint }}</pre> #}
|
{# <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>
|
<span class="text-nowrap"><strong>CO₂:</strong> {{ "{:,.1f}".format(flight.co2_kg) }} kg</span>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue