From e3aef95662c4fd433f6aeefbd09609d6d30a1fe9 Mon Sep 17 00:00:00 2001 From: Saria Hajjar Date: Tue, 14 Jan 2020 14:03:14 +0000 Subject: [PATCH] Fixed three-phase available power divide by zero --- netbox/templates/dcim/device.html | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/netbox/templates/dcim/device.html b/netbox/templates/dcim/device.html index 49927decb..103f6f5ae 100644 --- a/netbox/templates/dcim/device.html +++ b/netbox/templates/dcim/device.html @@ -378,10 +378,15 @@ Leg {{ leg.name }} {{ leg.outlet_count }} {{ leg.allocated }}VA - {{ powerfeed.available_power|divide:3 }}VA - {% with phase_available=powerfeed.available_power|divide:3 %} - {% utilization_graph leg.allocated|percentage:phase_available %} - {% endwith %} + {% if powerfeed.available_power %} + {{ powerfeed.available_power|divide:3 }}VA + {% with phase_available=powerfeed.available_power|divide:3 %} + {% utilization_graph leg.allocated|percentage:phase_available %} + {% endwith %} + {% else %} + — + — + {% endif %} {% endfor %} {% endwith %}