diff --git a/module/netbox/object_classes.py b/module/netbox/object_classes.py index 03f92b5..08f5249 100644 --- a/module/netbox/object_classes.py +++ b/module/netbox/object_classes.py @@ -1734,6 +1734,11 @@ def update(self, data=None, read_from_netbox=False, source=None): if "assigned_object_id" in self.updated_items: self.updated_items.append("assigned_object_type") + # if ip association has been removed we also need to get rid of object type + if "assigned_object_type" in self.updated_items and self.data.get("assigned_object_id") is None \ + and "assigned_object_type" in self.updated_items: + self.updated_items.remove("assigned_object_type") + if assigned_object is None or previous_ip_device_vm is None: return