Merge pull request #304 from tobiasge/fix-303

Fix #303 for Netbox v2.8.5
This commit is contained in:
Tobias Genannt 2020-05-29 10:03:22 +02:00 committed by GitHub
commit 9e06a38d41
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 5 additions and 4 deletions

View File

@ -1,5 +1,5 @@
from dcim.models import RackRole from dcim.models import RackRole
from utilities.forms import COLOR_CHOICES from utilities.choices import ColorChoices
from startup_script_utils import load_yaml from startup_script_utils import load_yaml
import sys import sys
@ -13,7 +13,7 @@ for params in rack_roles:
if 'color' in params: if 'color' in params:
color = params.pop('color') color = params.pop('color')
for color_tpl in COLOR_CHOICES: for color_tpl in ColorChoices:
if color in color_tpl: if color in color_tpl:
params['color'] = color_tpl[0] params['color'] = color_tpl[0]

View File

@ -1,5 +1,6 @@
from dcim.models import DeviceRole from dcim.models import DeviceRole
from utilities.forms import COLOR_CHOICES from utilities.choices import ColorChoices
from startup_script_utils import load_yaml from startup_script_utils import load_yaml
import sys import sys
@ -13,7 +14,7 @@ for params in device_roles:
if 'color' in params: if 'color' in params:
color = params.pop('color') color = params.pop('color')
for color_tpl in COLOR_CHOICES: for color_tpl in ColorChoices:
if color in color_tpl: if color in color_tpl:
params['color'] = color_tpl[0] params['color'] = color_tpl[0]