Fixed three-phase available power divide by zero

This commit is contained in:
Saria Hajjar 2020-01-14 14:03:14 +00:00
parent 7531efcfec
commit e3aef95662

View File

@ -378,10 +378,15 @@
<td style="padding-left: 20px">Leg {{ leg.name }}</td> <td style="padding-left: 20px">Leg {{ leg.name }}</td>
<td>{{ leg.outlet_count }}</td> <td>{{ leg.outlet_count }}</td>
<td>{{ leg.allocated }}VA</td> <td>{{ leg.allocated }}VA</td>
{% if powerfeed.available_power %}
<td>{{ powerfeed.available_power|divide:3 }}VA</td> <td>{{ powerfeed.available_power|divide:3 }}VA</td>
{% with phase_available=powerfeed.available_power|divide:3 %} {% with phase_available=powerfeed.available_power|divide:3 %}
<td>{% utilization_graph leg.allocated|percentage:phase_available %}</td> <td>{% utilization_graph leg.allocated|percentage:phase_available %}</td>
{% endwith %} {% endwith %}
{% else %}
<td class="text-muted">&mdash;</td>
<td class="text-muted">&mdash;</td>
{% endif %}
</tr> </tr>
{% endfor %} {% endfor %}
{% endwith %} {% endwith %}