Skip to content

AssertionError response when attempting to create cable #12076

Discussion options

You must be logged in to vote

assert all(rp.positions == 1 for rp in rear_ports)

OK, here's some context for that code: it's trying to trace a cable path.

            # Step 6: Determine the "next hop" terminations, if applicable
            if not remote_terminations:
                break

            if isinstance(remote_terminations[0], FrontPort):
                # Follow FrontPorts to their corresponding RearPorts
                rear_ports = RearPort.objects.filter(
                    pk__in=[t.rear_port_id for t in remote_terminations]
                )
                if len(rear_ports) > 1:
                    assert all(rp.positions == 1 for rp in rear_ports)     <<<< EXCEPTION HERE
                elif …

Replies: 2 comments 6 replies

Comment options

You must be logged in to vote
1 reply
@mblue-fasttrack
Comment options

Comment options

You must be logged in to vote
5 replies
@mblue-fasttrack
Comment options

@candlerb
Comment options

@mblue-fasttrack
Comment options

@kkthxbye-code
Comment options

@mblue-fasttrack
Comment options

Answer selected by mblue-fasttrack
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
3 participants