Fixes #1274: Exclude unterminated circuits from topology maps

This commit is contained in:
Jeremy Stretch 2017-06-15 10:05:14 -04:00
parent a16218b311
commit 9b082eea14

View File

@ -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)