Update netbox/dcim/models/cables.py

Co-authored-by: Jeremy Stretch <jstretch@netboxlabs.com>
This commit is contained in:
Daniel Sheppard 2023-09-07 15:37:20 -05:00 committed by GitHub
parent 837811d019
commit e0f32926bb
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -572,7 +572,8 @@ class CablePath(models.Model):
q_filter = Q()
for lct in local_cable_terminations:
q_filter |= Q(cable=lct.cable, cable_end='A' if lct.cable_end == 'B' else 'B')
cable_end = 'A' if lct.cable_end == 'B' else 'B'
q_filter |= Q(cable=lct.cable, cable_end=cable_end)
assert q_filter is not Q()
remote_cable_terminations = CableTermination.objects.filter(q_filter)