Quellcode durchsuchen

Changelog & tweaks for #5650

Jeremy Stretch vor 4 Jahren
Ursprung
Commit
bcfc2e5f74

+ 1 - 0
docs/release-notes/version-2.10.md

@@ -12,6 +12,7 @@
 ### Bug Fixes
 ### Bug Fixes
 
 
 * [#5595](https://github.com/netbox-community/netbox/issues/5595) - Restore ability to delete an uploaded device type image
 * [#5595](https://github.com/netbox-community/netbox/issues/5595) - Restore ability to delete an uploaded device type image
+* [#5650](https://github.com/netbox-community/netbox/issues/5650) - Denote when the total length of a cable trace may exceed the indicated value
 * [#5953](https://github.com/netbox-community/netbox/issues/5953) - Support Markdown rendering for custom script descriptions
 * [#5953](https://github.com/netbox-community/netbox/issues/5953) - Support Markdown rendering for custom script descriptions
 * [#5962](https://github.com/netbox-community/netbox/issues/5962) - Ensure consistent display of change log action labels
 * [#5962](https://github.com/netbox-community/netbox/issues/5962) - Ensure consistent display of change log action labels
 * [#5966](https://github.com/netbox-community/netbox/issues/5966) - Skip Markdown reference link when tabbing through form fields
 * [#5966](https://github.com/netbox-community/netbox/issues/5966) - Skip Markdown reference link when tabbing through form fields

+ 3 - 1
netbox/dcim/models/cables.py

@@ -490,11 +490,13 @@ class CablePath(models.Model):
         cables = Cable.objects.filter(id__in=cable_ids, _abs_length__isnull=False)
         cables = Cable.objects.filter(id__in=cable_ids, _abs_length__isnull=False)
         total_length = cables.aggregate(total=Sum('_abs_length'))['total']
         total_length = cables.aggregate(total=Sum('_abs_length'))['total']
         is_definitive = len(cables) == len(cable_ids)
         is_definitive = len(cables) == len(cable_ids)
-        return (total_length, is_definitive)
+
+        return total_length, is_definitive
 
 
     def get_split_nodes(self):
     def get_split_nodes(self):
         """
         """
         Return all available next segments in a split cable path.
         Return all available next segments in a split cable path.
         """
         """
         rearport = path_node_to_object(self.path[-1])
         rearport = path_node_to_object(self.path[-1])
+
         return FrontPort.objects.filter(rear_port=rearport)
         return FrontPort.objects.filter(rear_port=rearport)

+ 1 - 1
netbox/templates/dcim/cable_trace.html

@@ -69,7 +69,7 @@
                                     <h5>Total segments: {{ traced_path|length }}</h5>
                                     <h5>Total segments: {{ traced_path|length }}</h5>
                                     <h5>Total length:
                                     <h5>Total length:
                                         {% if total_length %}
                                         {% if total_length %}
-                                            {% if not is_definitive %}&gt;{% endif %}{{ total_length|floatformat:"-2" }} Meters /
+                                            {{ total_length|floatformat:"-2" }}{% if not is_definitive %}+{% endif %} Meters /
                                             {{ total_length|meters_to_feet|floatformat:"-2" }} Feet
                                             {{ total_length|meters_to_feet|floatformat:"-2" }} Feet
                                         {% else %}
                                         {% else %}
                                             <span class="text-muted">N/A</span>
                                             <span class="text-muted">N/A</span>