mirror of
https://github.com/netbox-community/netbox.git
synced 2025-07-23 04:22:01 -06:00
Use ChoiceSet.values() for access to raw values
This commit is contained in:
parent
fe490d144a
commit
1d3651e255
@ -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))
|
||||
|
Loading…
Reference in New Issue
Block a user