We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 7538c8b commit 6476408Copy full SHA for 6476408
netbox_diode_plugin/api/matcher.py
@@ -449,7 +449,11 @@ def _prepare_data(self, data: dict) -> dict:
449
field = self.model_class._meta.get_field(field_name)
450
# special handling for object type -> content type id
451
if field.is_relation and hasattr(field, "related_model") and field.related_model == ContentType:
452
- prepared[field_name] = content_type_id(value)
+ # Handle ManyToMany fields (list of object types) and ForeignKey fields (single object type)
453
+ if isinstance(value, list):
454
+ prepared[field_name] = [content_type_id(v) for v in value]
455
+ else:
456
+ prepared[field_name] = content_type_id(value)
457
else:
458
prepared[field_name] = value
459
0 commit comments