12216 review changes

This commit is contained in:
Arthur 2023-10-23 13:50:17 -07:00
parent 22f92417a8
commit f6e6e7778b
3 changed files with 8 additions and 4 deletions

View File

@ -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):

View File

@ -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

View File

@ -32,7 +32,11 @@
<tr>
<th scope="row">{% trans "Color" %}</th>
<td>
<span class="badge color-label" style="background-color: #{{ object.color }}">&nbsp;</span>
{% if object.color %}
<span class="badge color-label" style="background-color: #{{ object.color }}">&nbsp;</span>
{% else %}
{{ ''|placeholder }}
{% endif %}
</td>
</tr>
</table>