fix error for is_oob_ip for non-device parents

This commit is contained in:
Jamie Murphy 2023-08-30 22:05:45 +01:00
parent 671a56100a
commit 0f1247c6ef
No known key found for this signature in database
GPG Key ID: 10EDAE1E6D858F5F

View File

@ -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 parent.__class__.__name__ == "Device" and parent.oob_ip_id == self.pk:
return True
return False