Avoid crash when flight.co2_kg is not set.
This commit is contained in:
parent
53f4252b92
commit
84dfafefa1
1 changed files with 2 additions and 0 deletions
|
|
@ -497,7 +497,9 @@ 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 %}
|
||||
<span class="text-nowrap"><strong>CO₂:</strong> {{ "{:,.1f}".format(flight.co2_kg) }} kg</span>
|
||||
{% endif %}
|
||||
{% endif %}
|
||||
{% if e.detail.distance %}
|
||||
<span class="text-nowrap"><strong>distance:</strong> {{ format_distance(e.detail.distance) }}</span>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue