diff --git a/netbox/circuits/models.py b/netbox/circuits/models.py index a51a7039a..ca792ae2c 100644 --- a/netbox/circuits/models.py +++ b/netbox/circuits/models.py @@ -300,9 +300,6 @@ class CircuitTermination(CableTermination): blank=True ) - # Paths do not end on cable terminations, they continue at the other end of the circuit - is_path_endpoint = False - # But they are a possible connected endpoint is_connected_endpoint = True diff --git a/netbox/dcim/models/__init__.py b/netbox/dcim/models/__init__.py index 87077ea19..0e10e97c8 100644 --- a/netbox/dcim/models/__init__.py +++ b/netbox/dcim/models/__init__.py @@ -2129,6 +2129,7 @@ class Cable(ChangeLoggedModel): return reverse('dcim:cable', args=[self.pk]) def clean(self): + from circuits.models import CircuitTermination # Validate that termination A exists if not hasattr(self, 'termination_a_type'): @@ -2198,7 +2199,7 @@ class Cable(ChangeLoggedModel): (self.termination_b, self.termination_a) ]: if isinstance(term_a, RearPort) and term_a.positions > 1: - if term_b.is_path_endpoint: + if not isinstance(term_b, (FrontPort, RearPort, CircuitTermination)): raise ValidationError( "Rear ports with multiple positions may only be connected to other pass-through ports" ) diff --git a/netbox/dcim/models/device_components.py b/netbox/dcim/models/device_components.py index 4fb3a9f05..1d6623117 100644 --- a/netbox/dcim/models/device_components.py +++ b/netbox/dcim/models/device_components.py @@ -86,9 +86,6 @@ class CableTermination(models.Model): object_id_field='termination_b_id' ) - # Whether this class is always an endpoint for cable traces - is_path_endpoint = True - # Whether this class can be a connected endpoint is_connected_endpoint = True @@ -900,9 +897,6 @@ class FrontPort(CableTermination, ComponentModel): csv_headers = ['device', 'name', 'type', 'rear_port', 'rear_port_position', 'description'] - # Whether this class is always an endpoint for cable traces - is_path_endpoint = False - # Whether this class can be a connected endpoint is_connected_endpoint = False @@ -973,9 +967,6 @@ class RearPort(CableTermination, ComponentModel): csv_headers = ['device', 'name', 'type', 'positions', 'description'] - # Whether this class is always an endpoint for cable traces - is_path_endpoint = False - # Whether this class can be a connected endpoint is_connected_endpoint = False