diff --git a/pynetbox/core/response.py b/pynetbox/core/response.py index 066a5785..19afdee7 100644 --- a/pynetbox/core/response.py +++ b/pynetbox/core/response.py @@ -373,7 +373,6 @@ def generic_list_parser(key_name, list_item): and "object" in list_item ): lookup = list_item["object_type"] - model = None model = CONTENT_TYPE_MAPPER.get(lookup) if model: return model(list_item["object"], self.api, self.endpoint) @@ -495,7 +494,7 @@ def serialize(self, nested=False, init=False): if isinstance(current_val, list): current_val = [ - v.id if isinstance(v, Record) else v for v in current_val + v.serialize() if isinstance(v, Record) else v for v in current_val ] if i in LIST_AS_SET and ( all([isinstance(v, str) for v in current_val])