Skip to content

Commit 78c8982

Browse files
committed
Fixes #14550: Fix changing event rule action type from webhook to script
1 parent a233dc9 commit 78c8982

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

netbox/extras/forms/model_forms.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -307,11 +307,10 @@ def init_script_choice(self):
307307
choices.append((str(module), scripts))
308308
self.fields['action_choice'].choices = choices
309309

310-
if self.instance.pk:
310+
if self.instance.pk and self.instance.action_parameters:
311311
scriptmodule_id = self.instance.action_object_id
312312
script_name = self.instance.action_parameters.get('script_name')
313313
self.fields['action_choice'].initial = f'{scriptmodule_id}:{script_name}'
314-
print(self.fields['action_choice'].initial)
315314

316315
def init_webhook_choice(self):
317316
initial = None

0 commit comments

Comments
 (0)