mirror of
https://github.com/netbox-community/netbox.git
synced 2025-07-13 16:47:34 -06:00
Fixes #7279: Fix exception when tracing cable with no associated path
This commit is contained in:
parent
de58f53f9f
commit
aa05097fca
@ -15,6 +15,7 @@
|
|||||||
* [#7167](https://github.com/netbox-community/netbox/issues/7167) - Ensure consistent font size when using monospace formatting
|
* [#7167](https://github.com/netbox-community/netbox/issues/7167) - Ensure consistent font size when using monospace formatting
|
||||||
* [#7226](https://github.com/netbox-community/netbox/issues/7226) - Exempt GraphQL API requests from CSRF inspection
|
* [#7226](https://github.com/netbox-community/netbox/issues/7226) - Exempt GraphQL API requests from CSRF inspection
|
||||||
* [#7248](https://github.com/netbox-community/netbox/issues/7248) - Fix global search results section links
|
* [#7248](https://github.com/netbox-community/netbox/issues/7248) - Fix global search results section links
|
||||||
|
* [#7279](https://github.com/netbox-community/netbox/issues/7279) - Fix exception when tracing cable with no associated path
|
||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
|
@ -2411,6 +2411,12 @@ class PathTraceView(generic.ObjectView):
|
|||||||
else:
|
else:
|
||||||
path = related_paths.first()
|
path = related_paths.first()
|
||||||
|
|
||||||
|
# No paths found
|
||||||
|
if path is None:
|
||||||
|
return {
|
||||||
|
'path': None
|
||||||
|
}
|
||||||
|
|
||||||
# Get the total length of the cable and whether the length is definitive (fully defined)
|
# Get the total length of the cable and whether the length is definitive (fully defined)
|
||||||
total_length, is_definitive = path.get_total_length() if path else (None, False)
|
total_length, is_definitive = path.get_total_length() if path else (None, False)
|
||||||
|
|
||||||
|
@ -5,7 +5,10 @@
|
|||||||
|
|
||||||
{% block content %}
|
{% block content %}
|
||||||
<div class="row">
|
<div class="row">
|
||||||
|
|
||||||
|
{# Cable trace SVG & options #}
|
||||||
<div class="col col-md-5">
|
<div class="col col-md-5">
|
||||||
|
{% if path %}
|
||||||
<div class="text-center my-3">
|
<div class="text-center my-3">
|
||||||
<object data="{{ svg_url }}" class="rack_elevation"></object>
|
<object data="{{ svg_url }}" class="rack_elevation"></object>
|
||||||
<a class="btn btn-outline-primary btn-sm my-3" href="{{ svg_url }}">
|
<a class="btn btn-outline-primary btn-sm my-3" href="{{ svg_url }}">
|
||||||
@ -51,9 +54,15 @@
|
|||||||
{% endif %}
|
{% endif %}
|
||||||
{% endwith %}
|
{% endwith %}
|
||||||
</div>
|
</div>
|
||||||
|
{% else %}
|
||||||
|
<h3 class="text-center text-muted my-3">
|
||||||
|
No paths found
|
||||||
|
</h3>
|
||||||
|
{% endif %}
|
||||||
</div>
|
</div>
|
||||||
<div class="col col-md-7">
|
|
||||||
|
|
||||||
|
{# Related paths #}
|
||||||
|
<div class="col col-md-7">
|
||||||
<div class="card">
|
<div class="card">
|
||||||
<h5 class="card-header">
|
<h5 class="card-header">
|
||||||
Related Paths
|
Related Paths
|
||||||
@ -95,7 +104,7 @@
|
|||||||
</table>
|
</table>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
{% endblock %}
|
{% endblock %}
|
||||||
|
Loading…
Reference in New Issue
Block a user