From 26e14bc8e1ca27d4e642f3bd47341c7d0c8cd340 Mon Sep 17 00:00:00 2001 From: Josh VanDeraa Date: Sun, 8 Nov 2020 04:02:48 +0000 Subject: [PATCH] Updates helper for mutliple types --- netbox/utilities/templatetags/helpers.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/netbox/utilities/templatetags/helpers.py b/netbox/utilities/templatetags/helpers.py index fe4703345..bf6c9c1f1 100644 --- a/netbox/utilities/templatetags/helpers.py +++ b/netbox/utilities/templatetags/helpers.py @@ -234,6 +234,13 @@ def utilization_graph(utilization, warning_threshold=75, danger_threshold=90): """ Display a horizontal bar graph indicating a percentage of utilization. """ + if isinstance(utilization, int): + return { + 'utilization': utilization, + 'warning_threshold': warning_threshold, + 'danger_threshold': danger_threshold, + } + return { 'utilization': utilization[0], 'warning_threshold': warning_threshold,