mirror of
https://github.com/netbox-community/netbox.git
synced 2025-07-28 11:26:26 -06:00
Add defensive break if q_filter has not been populated
This commit is contained in:
parent
b6265d8285
commit
d5468cc573
@ -607,6 +607,10 @@ class CablePath(models.Model):
|
|||||||
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)
|
q_filter |= Q(cable=lct.cable, cable_end=cable_end)
|
||||||
|
|
||||||
|
# Make sure this filter has been populated; if not, we have probably been given invalid data
|
||||||
|
if not q_filter:
|
||||||
|
break
|
||||||
|
|
||||||
remote_cable_terminations = CableTermination.objects.filter(q_filter)
|
remote_cable_terminations = CableTermination.objects.filter(q_filter)
|
||||||
remote_terminations = [ct.termination for ct in remote_cable_terminations]
|
remote_terminations = [ct.termination for ct in remote_cable_terminations]
|
||||||
else:
|
else:
|
||||||
|
Loading…
Reference in New Issue
Block a user