1
0
mirror of https://github.com/netbox-community/netbox.git synced 2024-05-10 07:54:54 +00:00

Closes #14361: Add a description field to Webhook (#14380)

This commit is contained in:
Jeremy Stretch
2023-11-30 17:02:45 -05:00
committed by GitHub
parent a38a38218b
commit b812a50ca2
12 changed files with 49 additions and 17 deletions

View File

@@ -178,6 +178,11 @@ class WebhookBulkEditForm(NetBoxModelBulkEditForm):
queryset=Webhook.objects.all(),
widget=forms.MultipleHiddenInput
)
description = forms.CharField(
label=_('Description'),
max_length=200,
required=False
)
http_method = forms.ChoiceField(
choices=add_blank_choice(WebhookHttpMethodChoices),
required=False,
@@ -242,7 +247,7 @@ class EventRuleBulkEditForm(NetBoxModelBulkEditForm):
widget=BulkEditNullBooleanSelect()
)
nullable_fields = ('conditions',)
nullable_fields = ('description', 'conditions',)
class TagBulkEditForm(BulkEditForm):

View File

@@ -150,7 +150,7 @@ class WebhookImportForm(NetBoxModelImportForm):
model = Webhook
fields = (
'name', 'payload_url', 'http_method', 'http_content_type', 'additional_headers', 'body_template',
'secret', 'ssl_verification', 'ca_file_path', 'tags'
'secret', 'ssl_verification', 'ca_file_path', 'description', 'tags'
)

View File

@@ -215,7 +215,7 @@ class BookmarkForm(BootstrapMixin, forms.ModelForm):
class WebhookForm(NetBoxModelForm):
fieldsets = (
(_('Webhook'), ('name', 'tags',)),
(_('Webhook'), ('name', 'description', 'tags',)),
(_('HTTP Request'), (
'payload_url', 'http_method', 'http_content_type', 'additional_headers', 'body_template', 'secret',
)),