Skip to content

Commit

Permalink
fixes issue with wrongly assign 'assigned_object_type' to not associa…
Browse files Browse the repository at this point in the history
…ted IP address #361
  • Loading branch information
bb-Ricardo committed Jan 24, 2024
1 parent 7e4f8da commit 824263d
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions module/netbox/object_classes.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down

0 comments on commit 824263d

Please sign in to comment.