Skip to content

Commit

Permalink
15855 fix adding script as event rule
Browse files Browse the repository at this point in the history
  • Loading branch information
arthanson committed Apr 26, 2024
1 parent 5af3c65 commit b12bfaa
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions netbox/extras/api/serializers_/events.py
Expand Up @@ -47,8 +47,7 @@ def get_action_object(self, instance):
# We need to manually instantiate the serializer for scripts
if instance.action_type == EventRuleActionChoices.SCRIPT:
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:
serializer = get_serializer_for_model(instance.action_object_type.model_class())
return serializer(instance.action_object, nested=True, context=context).data
Expand Down

0 comments on commit b12bfaa

Please sign in to comment.