mirror of
https://github.com/netbox-community/netbox.git
synced 2025-08-24 00:15:17 -06:00
14132 add payload_url to webhook filterset
This commit is contained in:
parent
92ab4a0a25
commit
bbd008e152
@ -43,6 +43,9 @@ class WebhookFilterSet(NetBoxModelFilterSet):
|
|||||||
http_method = django_filters.MultipleChoiceFilter(
|
http_method = django_filters.MultipleChoiceFilter(
|
||||||
choices=WebhookHttpMethodChoices
|
choices=WebhookHttpMethodChoices
|
||||||
)
|
)
|
||||||
|
payload_url = MultiValueCharFilter(
|
||||||
|
lookup_expr='icontains'
|
||||||
|
)
|
||||||
|
|
||||||
class Meta:
|
class Meta:
|
||||||
model = Webhook
|
model = Webhook
|
||||||
|
@ -226,10 +226,14 @@ class SavedFilterFilterForm(SavedFiltersMixin, FilterForm):
|
|||||||
class WebhookFilterForm(NetBoxModelFilterSetForm):
|
class WebhookFilterForm(NetBoxModelFilterSetForm):
|
||||||
model = Webhook
|
model = Webhook
|
||||||
tag = TagFilterField(model)
|
tag = TagFilterField(model)
|
||||||
|
payload_url = forms.CharField(
|
||||||
|
label=_('Payload URL'),
|
||||||
|
required=False
|
||||||
|
)
|
||||||
|
|
||||||
fieldsets = (
|
fieldsets = (
|
||||||
(None, ('q', 'filter_id', 'tag')),
|
(None, ('q', 'filter_id', 'tag')),
|
||||||
(_('Attributes'), ('http_method',)),
|
(_('Attributes'), ('payload_url', 'http_method',)),
|
||||||
)
|
)
|
||||||
http_method = forms.MultipleChoiceField(
|
http_method = forms.MultipleChoiceField(
|
||||||
choices=WebhookHttpMethodChoices,
|
choices=WebhookHttpMethodChoices,
|
||||||
|
Loading…
Reference in New Issue
Block a user