소스 검색

Clean up tests

jeremystretch 4 년 전
부모
커밋
6befd2155a
1개의 변경된 파일2개의 추가작업 그리고 2개의 파일을 삭제
  1. 2 2
      netbox/dcim/models/cables.py

+ 2 - 2
netbox/dcim/models/cables.py

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