Explorar o código

fix error for is_oob_ip for non-device parents (#13621)

* fix error for is_oob_ip for non-device parents

* adjust oob_ip_id check to use hasattr
Jamie (Bear) Murphy %!s(int64=2) %!d(string=hai) anos
pai
achega
46f734eba2
Modificáronse 1 ficheiros con 1 adicións e 1 borrados
  1. 1 1
      netbox/ipam/models/ip.py

+ 1 - 1
netbox/ipam/models/ip.py

@@ -892,7 +892,7 @@ class IPAddress(PrimaryModel):
     def is_oob_ip(self):
         if self.assigned_object:
             parent = getattr(self.assigned_object, 'parent_object', None)
-            if parent.oob_ip_id == self.pk:
+            if hasattr(parent, "oob_ip_id") and parent.oob_ip_id == self.pk:
                 return True
         return False