|
@@ -47,8 +47,7 @@ class EventRuleSerializer(NetBoxModelSerializer):
|
|
|
# We need to manually instantiate the serializer for scripts
|
|
# We need to manually instantiate the serializer for scripts
|
|
|
if instance.action_type == EventRuleActionChoices.SCRIPT:
|
|
if instance.action_type == EventRuleActionChoices.SCRIPT:
|
|
|
script = instance.action_object
|
|
script = instance.action_object
|
|
|
- instance = script.python_class() if script.python_class else None
|
|
|
|
|
- return ScriptSerializer(instance, nested=True, context=context).data
|
|
|
|
|
|
|
+ return ScriptSerializer(script, nested=True, context=context).data
|
|
|
else:
|
|
else:
|
|
|
serializer = get_serializer_for_model(instance.action_object_type.model_class())
|
|
serializer = get_serializer_for_model(instance.action_object_type.model_class())
|
|
|
return serializer(instance.action_object, nested=True, context=context).data
|
|
return serializer(instance.action_object, nested=True, context=context).data
|