Fix #303 for Netbox v2.8.5
In this Netbox version the ColorChoices where moved to utilities.choiceFix #303 for Netbox v2.8.5 In this Netbox version the ColorChoices where moved to utilities.choicess
This commit is contained in:
parent
45f7823a17
commit
b7ad18afb0
|
@ -1,5 +1,5 @@
|
|||
from dcim.models import RackRole
|
||||
from utilities.forms import COLOR_CHOICES
|
||||
from utilities.choices import ColorChoices
|
||||
|
||||
from startup_script_utils import load_yaml
|
||||
import sys
|
||||
|
@ -13,7 +13,7 @@ for params in rack_roles:
|
|||
if 'color' in params:
|
||||
color = params.pop('color')
|
||||
|
||||
for color_tpl in COLOR_CHOICES:
|
||||
for color_tpl in ColorChoices:
|
||||
if color in color_tpl:
|
||||
params['color'] = color_tpl[0]
|
||||
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
from dcim.models import DeviceRole
|
||||
from utilities.forms import COLOR_CHOICES
|
||||
from utilities.choices import ColorChoices
|
||||
|
||||
from startup_script_utils import load_yaml
|
||||
import sys
|
||||
|
||||
|
@ -13,7 +14,7 @@ for params in device_roles:
|
|||
if 'color' in params:
|
||||
color = params.pop('color')
|
||||
|
||||
for color_tpl in COLOR_CHOICES:
|
||||
for color_tpl in ColorChoices:
|
||||
if color in color_tpl:
|
||||
params['color'] = color_tpl[0]
|
||||
|
||||
|
|
Loading…
Reference in New Issue