diff --git a/netbox/extras/forms/filtersets.py b/netbox/extras/forms/filtersets.py index e04fe87bc..90d39484d 100644 --- a/netbox/extras/forms/filtersets.py +++ b/netbox/extras/forms/filtersets.py @@ -225,21 +225,24 @@ class SavedFilterFilterForm(SavedFiltersMixin, FilterForm): class WebhookFilterForm(NetBoxModelFilterSetForm): model = Webhook - tag = TagFilterField(model) + fieldsets = ( + (None, ('q', 'filter_id', 'tag')), + (_('Attributes'), ('payload_url', 'http_method', 'http_content_type')), + ) + http_content_type = forms.CharField( + label=_('HTTP content type'), + required=False + ) payload_url = forms.CharField( label=_('Payload URL'), required=False ) - - fieldsets = ( - (None, ('q', 'filter_id', 'tag')), - (_('Attributes'), ('payload_url', 'http_method',)), - ) http_method = forms.MultipleChoiceField( choices=WebhookHttpMethodChoices, required=False, label=_('HTTP method') ) + tag = TagFilterField(model) class EventRuleFilterForm(NetBoxModelFilterSetForm): @@ -248,7 +251,7 @@ class EventRuleFilterForm(NetBoxModelFilterSetForm): fieldsets = ( (None, ('q', 'filter_id', 'tag')), - (_('Attributes'), ('content_type_id', 'enabled')), + (_('Attributes'), ('content_type_id', 'action_type', 'enabled')), (_('Events'), ('type_create', 'type_update', 'type_delete', 'type_job_start', 'type_job_end')), ) content_type_id = ContentTypeMultipleChoiceField( @@ -256,6 +259,11 @@ class EventRuleFilterForm(NetBoxModelFilterSetForm): required=False, label=_('Object type') ) + action_type = forms.ChoiceField( + choices=add_blank_choice(EventRuleActionChoices), + required=False, + label=_('Action type') + ) enabled = forms.NullBooleanField( label=_('Enabled'), required=False,