fix issue with cached data from previous NetBox versions #415

This commit is contained in:
ricardo.bartels@telekom.de
2024-09-28 00:19:06 +02:00
parent b3fe545d99
commit 19664389a8
2 changed files with 31 additions and 2 deletions
+3
View File
@@ -1196,6 +1196,9 @@ class NBCustomField(NetBoxObject):
if isinstance(data.get("object_types"), str):
data["object_types"] = [data.get("object_types")]
elif data.get("object_types") is None:
data["object_types"] = []
for object_type in data.get("object_types"):
if object_type not in self.valid_object_types and read_from_netbox is False:
log.error(f"Invalid content type '{object_type}' for {self.name}")