mirror of
https://github.com/netbox-community/netbox.git
synced 2025-08-18 05:28:16 -06:00
14132 fix csv import
This commit is contained in:
parent
593b8697cf
commit
e1c7a03f3a
@ -180,8 +180,9 @@ class EventRuleImportForm(NetBoxModelImportForm):
|
||||
action_type = self.cleaned_data.get('action_type')
|
||||
if action_object and action_type:
|
||||
if action_type == EventRuleActionChoices.WEBHOOK:
|
||||
webhook = Webhook.objects.filter(name=action_object)
|
||||
if not webhook:
|
||||
try:
|
||||
webhook = Webhook.objects.get(name=action_object)
|
||||
except Webhook.ObjectDoesNotExist:
|
||||
raise forms.ValidationError(f"Webhook {action_object} not found")
|
||||
self.instance.action_object = webhook
|
||||
elif action_type == EventRuleActionChoices.SCRIPT:
|
||||
|
Loading…
Reference in New Issue
Block a user