1
0
mirror of https://github.com/netbox-community/netbox.git synced 2024-05-10 07:54:54 +00:00

Store the front ports on the position_stack so we can provide better feedback to the user

This commit is contained in:
Sander Steffann
2020-06-16 21:47:37 +02:00
parent 4a11800d9e
commit abaf0daa6e
2 changed files with 10 additions and 3 deletions

View File

@@ -124,7 +124,7 @@ class CableTermination(models.Model):
# many-to-one points so we can select the correct FrontPort when we reach the corresponding
# one-to-many point.
if peer_port.positions > 1:
position_stack.append(termination.rear_port_position)
position_stack.append(termination)
return peer_port
@@ -135,7 +135,8 @@ class CableTermination(models.Model):
if not position_stack:
raise CableTraceSplit(termination)
position = position_stack.pop()
front_port = position_stack.pop()
position = front_port.rear_port_position
# Validate the position
if position not in range(1, termination.positions + 1):