mirror of
https://github.com/netbox-community/netbox.git
synced 2025-08-13 19:18:16 -06:00
Allow single-position links to carry multi-position channels
This commit is contained in:
parent
d092f14afb
commit
0dc01681b1
@ -2852,15 +2852,15 @@ class Cable(ChangeLoggedModel):
|
||||
))
|
||||
|
||||
# A component with multiple positions must be connected to a component with an equal number of positions
|
||||
# FIXME SJMS not really, they can be connected through a chain of links
|
||||
# term_a_positions = getattr(self.termination_a, 'positions', 1)
|
||||
# term_b_positions = getattr(self.termination_b, 'positions', 1)
|
||||
# if term_a_positions != term_b_positions:
|
||||
# raise ValidationError(
|
||||
# "{} has {} positions and {} has {}. Both terminations must have the same number of positions.".format(
|
||||
# self.termination_a, term_a_positions, self.termination_b, term_b_positions
|
||||
# )
|
||||
# )
|
||||
# but components with one position can be carriers for multiplexed channels
|
||||
term_a_positions = getattr(self.termination_a, 'positions', 1)
|
||||
term_b_positions = getattr(self.termination_b, 'positions', 1)
|
||||
if term_a_positions != term_b_positions and term_a_positions > 1 and term_b_positions > 1:
|
||||
raise ValidationError(
|
||||
"{} has {} positions and {} has {}. Both terminations must have the same number of positions.".format(
|
||||
self.termination_a, term_a_positions, self.termination_b, term_b_positions
|
||||
)
|
||||
)
|
||||
|
||||
# A termination point cannot be connected to itself
|
||||
if self.termination_a == self.termination_b:
|
||||
|
Loading…
Reference in New Issue
Block a user