This commit is contained in:
Brian Tiemann 2024-11-19 11:27:26 -05:00
parent 4626649754
commit 19076fe43c

View File

@ -525,7 +525,7 @@ class CablePath(models.Model):
return int(len(self.path) / 3) return int(len(self.path) / 3)
@classmethod @classmethod
def from_origin(cls, terminations, max_length=None): def from_origin(cls, terminations, max_length=settings.CABLE_TRACE_MAX_LENGTH):
""" """
Create a new CablePath instance as traced from the given termination objects. These can be any object to which a Create a new CablePath instance as traced from the given termination objects. These can be any object to which a
Cable or WirelessLink connects (interfaces, console ports, circuit termination, etc.). All terminations must be Cable or WirelessLink connects (interfaces, console ports, circuit termination, etc.). All terminations must be
@ -533,8 +533,6 @@ class CablePath(models.Model):
""" """
from circuits.models import CircuitTermination from circuits.models import CircuitTermination
max_length = max_length or settings.CABLE_TRACE_MAX_LENGTH
if not terminations: if not terminations:
return None return None
@ -590,7 +588,6 @@ class CablePath(models.Model):
# Step 4: Record the links, keeping cables in order to allow for SVG rendering # Step 4: Record the links, keeping cables in order to allow for SVG rendering
cables = [] cables = []
for link in links: for link in links:
cable = object_to_path_node(link) cable = object_to_path_node(link)
if cable not in cables: if cable not in cables: