From 9b082eea1432a3545fe21f08b3dd6505ae903ff1 Mon Sep 17 00:00:00 2001 From: Jeremy Stretch Date: Thu, 15 Jun 2017 10:05:14 -0400 Subject: [PATCH] Fixes #1274: Exclude unterminated circuits from topology maps --- netbox/extras/models.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/netbox/extras/models.py b/netbox/extras/models.py index bea8a664b..ade251c94 100644 --- a/netbox/extras/models.py +++ b/netbox/extras/models.py @@ -371,7 +371,8 @@ class TopologyMap(models.Model): # Add all circuits to the graph for termination in CircuitTermination.objects.filter(term_side='A', interface__device__in=devices): peer_termination = termination.get_peer_termination() - if peer_termination is not None and peer_termination.interface.device in devices: + if (peer_termination is not None and peer_termination.interface is not None and + peer_termination.interface.device in devices): graph.edge(termination.interface.device.name, peer_termination.interface.device.name, color='blue') return graph.pipe(format=img_format)