Skip to content

Commit

Permalink
Fixes #14550: Fix changing event rule action type from webhook to script
Browse files Browse the repository at this point in the history
  • Loading branch information
jeremystretch committed Dec 20, 2023
1 parent a233dc9 commit 78c8982
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions netbox/extras/forms/model_forms.py
Original file line number Diff line number Diff line change
Expand Up @@ -307,11 +307,10 @@ def init_script_choice(self):
choices.append((str(module), scripts))
self.fields['action_choice'].choices = choices

if self.instance.pk:
if self.instance.pk and self.instance.action_parameters:
scriptmodule_id = self.instance.action_object_id
script_name = self.instance.action_parameters.get('script_name')
self.fields['action_choice'].initial = f'{scriptmodule_id}:{script_name}'
print(self.fields['action_choice'].initial)

def init_webhook_choice(self):
initial = None
Expand Down

0 comments on commit 78c8982

Please sign in to comment.