mirror of
https://github.com/netbox-community/netbox.git
synced 2025-08-23 16:06:43 -06:00
14132 form cleanup
This commit is contained in:
parent
854b3ba632
commit
e0b10c984b
@ -224,36 +224,21 @@ class BookmarkForm(BootstrapMixin, forms.ModelForm):
|
|||||||
|
|
||||||
|
|
||||||
class WebhookForm(NetBoxModelForm):
|
class WebhookForm(NetBoxModelForm):
|
||||||
content_types = ContentTypeMultipleChoiceField(
|
|
||||||
label=_('Content types'),
|
|
||||||
queryset=ContentType.objects.all(),
|
|
||||||
limit_choices_to=FeatureQuery('webhooks')
|
|
||||||
)
|
|
||||||
|
|
||||||
fieldsets = (
|
fieldsets = (
|
||||||
(_('Webhook'), ('name', 'content_types', 'enabled', 'tags')),
|
(_('Webhook'), ('tags',)),
|
||||||
(_('Events'), ('type_create', 'type_update', 'type_delete', 'type_job_start', 'type_job_end')),
|
|
||||||
(_('HTTP Request'), (
|
(_('HTTP Request'), (
|
||||||
'payload_url', 'http_method', 'http_content_type', 'additional_headers', 'body_template', 'secret',
|
'payload_url', 'http_method', 'http_content_type', 'additional_headers', 'body_template', 'secret',
|
||||||
)),
|
)),
|
||||||
(_('Conditions'), ('conditions',)),
|
|
||||||
(_('SSL'), ('ssl_verification', 'ca_file_path')),
|
(_('SSL'), ('ssl_verification', 'ca_file_path')),
|
||||||
)
|
)
|
||||||
|
|
||||||
class Meta:
|
class Meta:
|
||||||
model = Webhook
|
model = Webhook
|
||||||
fields = '__all__'
|
fields = '__all__'
|
||||||
labels = {
|
|
||||||
'type_create': _('Creations'),
|
|
||||||
'type_update': _('Updates'),
|
|
||||||
'type_delete': _('Deletions'),
|
|
||||||
'type_job_start': _('Job executions'),
|
|
||||||
'type_job_end': _('Job terminations'),
|
|
||||||
}
|
|
||||||
widgets = {
|
widgets = {
|
||||||
'additional_headers': forms.Textarea(attrs={'class': 'font-monospace'}),
|
'additional_headers': forms.Textarea(attrs={'class': 'font-monospace'}),
|
||||||
'body_template': forms.Textarea(attrs={'class': 'font-monospace'}),
|
'body_template': forms.Textarea(attrs={'class': 'font-monospace'}),
|
||||||
'conditions': forms.Textarea(attrs={'class': 'font-monospace'}),
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user