From 1d3651e2556a2dce8a2482ea1e3b56800fa81029 Mon Sep 17 00:00:00 2001 From: Jeremy Stretch Date: Thu, 9 Jan 2020 14:56:33 -0500 Subject: [PATCH] Use ChoiceSet.values() for access to raw values --- netbox/utilities/utils.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/netbox/utilities/utils.py b/netbox/utilities/utils.py index 1f18b9e33..de3dd8ce6 100644 --- a/netbox/utilities/utils.py +++ b/netbox/utilities/utils.py @@ -168,7 +168,7 @@ def to_meters(length, unit): if length < 0: raise ValueError("Length must be a positive integer") - valid_units = [u[0] for u in CableLengthUnitChoices] + valid_units = CableLengthUnitChoices.values() if unit not in valid_units: raise ValueError( "Unknown unit {}. Must be one of the following: {}".format(unit, ', '.join(valid_units))