This commit is contained in:
Arthur 2026-07-23 14:23:49 -07:00
parent b82016ce0d
commit 393c9d7307
2 changed files with 5 additions and 2 deletions

View File

@ -584,10 +584,9 @@ class WebhookForm(OwnerMixin, NetBoxModelForm):
FieldSet('name', 'description', 'tags', name=_('Webhook')),
FieldSet(
'payload_url', 'http_method', 'http_content_type', 'additional_headers', 'body_template', 'secret',
name=_('HTTP Request')
'timeout', name=_('HTTP Request')
),
FieldSet('ssl_verification', 'ca_file_path', name=_('SSL')),
FieldSet('timeout', name=_('Timeout')),
)
class Meta:

View File

@ -221,6 +221,10 @@ STORAGES = getattr(configuration, 'STORAGES', {})
TIME_ZONE = getattr(configuration, 'TIME_ZONE', 'UTC')
TRANSLATION_ENABLED = getattr(configuration, 'TRANSLATION_ENABLED', True)
WEBHOOK_DEFAULT_TIMEOUT = getattr(configuration, 'WEBHOOK_DEFAULT_TIMEOUT', 30)
if not isinstance(WEBHOOK_DEFAULT_TIMEOUT, int) or not 1 <= WEBHOOK_DEFAULT_TIMEOUT <= 3600:
raise ImproperlyConfigured(
f"WEBHOOK_DEFAULT_TIMEOUT must be an integer between 1 and 3600 (found {WEBHOOK_DEFAULT_TIMEOUT!r})"
)
DISK_BASE_UNIT = getattr(configuration, 'DISK_BASE_UNIT', 1000)
if DISK_BASE_UNIT not in [1000, 1024]:
raise ImproperlyConfigured(f"DISK_BASE_UNIT must be 1000 or 1024 (found {DISK_BASE_UNIT})")