From b6265d828526a97962e8feefa0ff57c534d2da27 Mon Sep 17 00:00:00 2001 From: Brian Tiemann Date: Sat, 21 Dec 2024 12:51:04 -0500 Subject: [PATCH] Iterate through a freshly queried set of CableTerminations to find endpoints in update_connected_endpoints --- netbox/dcim/signals.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/netbox/dcim/signals.py b/netbox/dcim/signals.py index a51872719a7..6c213d64c2b 100644 --- a/netbox/dcim/signals.py +++ b/netbox/dcim/signals.py @@ -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: