mirror of
https://github.com/netbox-community/netbox.git
synced 2025-07-23 04:22:01 -06:00
Store the front ports on the position_stack so we can provide better feedback to the user
This commit is contained in:
parent
4a11800d9e
commit
abaf0daa6e
@ -124,7 +124,7 @@ class CableTermination(models.Model):
|
|||||||
# many-to-one points so we can select the correct FrontPort when we reach the corresponding
|
# many-to-one points so we can select the correct FrontPort when we reach the corresponding
|
||||||
# one-to-many point.
|
# one-to-many point.
|
||||||
if peer_port.positions > 1:
|
if peer_port.positions > 1:
|
||||||
position_stack.append(termination.rear_port_position)
|
position_stack.append(termination)
|
||||||
|
|
||||||
return peer_port
|
return peer_port
|
||||||
|
|
||||||
@ -135,7 +135,8 @@ class CableTermination(models.Model):
|
|||||||
if not position_stack:
|
if not position_stack:
|
||||||
raise CableTraceSplit(termination)
|
raise CableTraceSplit(termination)
|
||||||
|
|
||||||
position = position_stack.pop()
|
front_port = position_stack.pop()
|
||||||
|
position = front_port.rear_port_position
|
||||||
|
|
||||||
# Validate the position
|
# Validate the position
|
||||||
if position not in range(1, termination.positions + 1):
|
if position not in range(1, termination.positions + 1):
|
||||||
|
@ -90,7 +90,13 @@
|
|||||||
</div>
|
</div>
|
||||||
{% elif position_stack %}
|
{% elif position_stack %}
|
||||||
<div class="col-md-11 col-md-offset-1">
|
<div class="col-md-11 col-md-offset-1">
|
||||||
<h3 class="text-warning text-center">Multiple possible paths end at this point. No connection established!</h3>
|
<h3 class="text-warning text-center">
|
||||||
|
{% with last_position=position_stack|last %}
|
||||||
|
Trace completed, but there is no Front Port corresponding to
|
||||||
|
<a href="{{ last_position.device.get_absolute_url }}">{{ last_position.device }}</a> {{ last_position }}.<br>
|
||||||
|
Therefore no end-to-end connection can be established.
|
||||||
|
{% endwith %}
|
||||||
|
</h3>
|
||||||
</div>
|
</div>
|
||||||
{% else %}
|
{% else %}
|
||||||
<div class="col-md-11 col-md-offset-1">
|
<div class="col-md-11 col-md-offset-1">
|
||||||
|
Loading…
Reference in New Issue
Block a user