From 393c9d7307aacbb3aedef58b878f602063e64627 Mon Sep 17 00:00:00 2001 From: Arthur Date: Thu, 23 Jul 2026 14:23:49 -0700 Subject: [PATCH] cleanup --- netbox/extras/forms/model_forms.py | 3 +-- netbox/netbox/settings.py | 4 ++++ 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/netbox/extras/forms/model_forms.py b/netbox/extras/forms/model_forms.py index 8891c47ee..b6d23ecaa 100644 --- a/netbox/extras/forms/model_forms.py +++ b/netbox/extras/forms/model_forms.py @@ -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: diff --git a/netbox/netbox/settings.py b/netbox/netbox/settings.py index eba103cf9..573ee9a51 100644 --- a/netbox/netbox/settings.py +++ b/netbox/netbox/settings.py @@ -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})")