|
@@ -317,7 +317,6 @@ class EventRuleImportForm(OwnerCSVMixin, NetBoxModelImportForm):
|
|
|
help_text=_("One or more assigned object types")
|
|
help_text=_("One or more assigned object types")
|
|
|
)
|
|
)
|
|
|
event_types = CSVMultipleChoiceField(
|
|
event_types = CSVMultipleChoiceField(
|
|
|
- choices=get_event_type_choices,
|
|
|
|
|
label=_('Event types'),
|
|
label=_('Event types'),
|
|
|
help_text=_('The event type(s) which will trigger this rule')
|
|
help_text=_('The event type(s) which will trigger this rule')
|
|
|
)
|
|
)
|
|
@@ -337,6 +336,11 @@ class EventRuleImportForm(OwnerCSVMixin, NetBoxModelImportForm):
|
|
|
'owner', 'comments', 'tags'
|
|
'owner', 'comments', 'tags'
|
|
|
)
|
|
)
|
|
|
|
|
|
|
|
|
|
+ def __init__(self, *args, **kwargs):
|
|
|
|
|
+ super().__init__(*args, **kwargs)
|
|
|
|
|
+ # Resolved per instance because plugins register event types after this module is imported
|
|
|
|
|
+ self.fields['event_types'].choices = get_event_type_choices()
|
|
|
|
|
+
|
|
|
def clean(self):
|
|
def clean(self):
|
|
|
super().clean()
|
|
super().clean()
|
|
|
|
|
|