1
0
mirror of https://github.com/netbox-community/netbox.git synced 2024-05-10 07:54:54 +00:00

Clean up tests

This commit is contained in:
jeremystretch
2022-06-01 11:38:31 -04:00
parent 7b02070007
commit 6befd2155a

View File

@ -198,9 +198,9 @@ class Cable(NetBoxModel):
# Store the parent Device for the A and B terminations (if applicable) to enable filtering # Store the parent Device for the A and B terminations (if applicable) to enable filtering
if hasattr(self, 'a_terminations'): if hasattr(self, 'a_terminations'):
self._termination_a_device = self.a_terminations[0].device self._termination_a_device = getattr(self.a_terminations[0], 'device', None)
if hasattr(self, 'b_terminations'): if hasattr(self, 'b_terminations'):
self._termination_b_device = self.b_terminations[0].device self._termination_b_device = getattr(self.b_terminations[0], 'device', None)
super().save(*args, **kwargs) super().save(*args, **kwargs)