Skip to content

Commit

Permalink
Iterate through a freshly queried set of CableTerminations to find en…
Browse files Browse the repository at this point in the history
…dpoints in update_connected_endpoints
  • Loading branch information
bctiemann committed Dec 21, 2024
1 parent 8c07978 commit b6265d8
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion netbox/dcim/signals.py
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,8 @@ def update_connected_endpoints(instance, created, raw=False, **kwargs):
if instance._terminations_modified:
a_terminations = []
b_terminations = []
for t in instance.terminations.all():
# Note: instance.terminations.all() is not safe to use here as it might be stale
for t in CableTermination.objects.filter(cable=instance):
if t.cable_end == CableEndChoices.SIDE_A:
a_terminations.append(t.termination)
else:
Expand Down

0 comments on commit b6265d8

Please sign in to comment.