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 model = CircuitType
fieldsets = ( fieldsets = (
(None, ('color', 'description',)), (None, ('color', 'description')),
) )
nullable_fields = ('color', 'description',) nullable_fields = ('color', 'description')
class CircuitBulkEditForm(NetBoxModelBulkEditForm): class CircuitBulkEditForm(NetBoxModelBulkEditForm):

View File

@ -182,7 +182,7 @@ class CableTraceSVG:
if hasattr(instance, 'role'): if hasattr(instance, 'role'):
# Device # Device
return instance.role.color return instance.role.color
elif instance._meta.model_name == 'circuit': elif instance._meta.model_name == 'circuit' and instance.type.color:
return instance.type.color return instance.type.color
else: else:
# Other parent object # Other parent object

View File

@ -32,7 +32,11 @@
<tr> <tr>
<th scope="row">{% trans "Color" %}</th> <th scope="row">{% trans "Color" %}</th>
<td> <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> </td>
</tr> </tr>
</table> </table>