From f6e6e7778bcb9d6491b4e835c21fdb13331a4d59 Mon Sep 17 00:00:00 2001 From: Arthur Date: Mon, 23 Oct 2023 13:50:17 -0700 Subject: [PATCH] 12216 review changes --- netbox/circuits/forms/bulk_edit.py | 4 ++-- netbox/dcim/svg/cables.py | 2 +- netbox/templates/circuits/circuittype.html | 6 +++++- 3 files changed, 8 insertions(+), 4 deletions(-) diff --git a/netbox/circuits/forms/bulk_edit.py b/netbox/circuits/forms/bulk_edit.py index 080c10225..5c416bff9 100644 --- a/netbox/circuits/forms/bulk_edit.py +++ b/netbox/circuits/forms/bulk_edit.py @@ -103,9 +103,9 @@ class CircuitTypeBulkEditForm(NetBoxModelBulkEditForm): model = CircuitType fieldsets = ( - (None, ('color', 'description',)), + (None, ('color', 'description')), ) - nullable_fields = ('color', 'description',) + nullable_fields = ('color', 'description') class CircuitBulkEditForm(NetBoxModelBulkEditForm): diff --git a/netbox/dcim/svg/cables.py b/netbox/dcim/svg/cables.py index 7b376661b..31e090078 100644 --- a/netbox/dcim/svg/cables.py +++ b/netbox/dcim/svg/cables.py @@ -182,7 +182,7 @@ class CableTraceSVG: if hasattr(instance, 'role'): # Device return instance.role.color - elif instance._meta.model_name == 'circuit': + elif instance._meta.model_name == 'circuit' and instance.type.color: return instance.type.color else: # Other parent object diff --git a/netbox/templates/circuits/circuittype.html b/netbox/templates/circuits/circuittype.html index 76e4a7884..407ee4042 100644 --- a/netbox/templates/circuits/circuittype.html +++ b/netbox/templates/circuits/circuittype.html @@ -32,7 +32,11 @@ {% trans "Color" %} -   + {% if object.color %} +   + {% else %} + {{ ''|placeholder }} + {% endif %}