From 4552cea39e517f368b6d469803782f24cefbc210 Mon Sep 17 00:00:00 2001 From: Arthur Date: Fri, 7 Mar 2025 13:50:06 -0800 Subject: [PATCH] 18423 review changes --- docs/customization/custom-scripts.md | 2 +- netbox/netbox/settings.py | 10 +++++----- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/docs/customization/custom-scripts.md b/docs/customization/custom-scripts.md index e165af3bd..e56de2a62 100644 --- a/docs/customization/custom-scripts.md +++ b/docs/customization/custom-scripts.md @@ -140,7 +140,7 @@ The Script class provides two convenience methods for reading data from files: These two methods will load data in YAML or JSON format, respectively, from files within the local path (i.e. `SCRIPTS_ROOT`). -**Note:** These convenience methods only work if running scripts within the local path, they will not work if running scripts using AWS S3. +**Note:** These convenience methods only work if running scripts within the local path, they will not work if using a storage other than ScriptFileSystemStorage. ## Logging diff --git a/netbox/netbox/settings.py b/netbox/netbox/settings.py index 68ec1435b..823a59e86 100644 --- a/netbox/netbox/settings.py +++ b/netbox/netbox/settings.py @@ -75,7 +75,6 @@ AUTH_PASSWORD_VALIDATORS = getattr(configuration, 'AUTH_PASSWORD_VALIDATORS', [ BASE_PATH = trailing_slash(getattr(configuration, 'BASE_PATH', '')) CHANGELOG_SKIP_EMPTY_CHANGES = getattr(configuration, 'CHANGELOG_SKIP_EMPTY_CHANGES', True) CENSUS_REPORTING_ENABLED = getattr(configuration, 'CENSUS_REPORTING_ENABLED', True) -CONFIG_STORAGES = getattr(configuration, 'STORAGES', {}) CORS_ORIGIN_ALLOW_ALL = getattr(configuration, 'CORS_ORIGIN_ALLOW_ALL', False) CORS_ORIGIN_REGEX_WHITELIST = getattr(configuration, 'CORS_ORIGIN_REGEX_WHITELIST', []) CORS_ORIGIN_WHITELIST = getattr(configuration, 'CORS_ORIGIN_WHITELIST', []) @@ -178,7 +177,8 @@ SESSION_COOKIE_PATH = CSRF_COOKIE_PATH SESSION_COOKIE_SECURE = getattr(configuration, 'SESSION_COOKIE_SECURE', False) SESSION_FILE_PATH = getattr(configuration, 'SESSION_FILE_PATH', None) STORAGE_BACKEND = getattr(configuration, 'STORAGE_BACKEND', None) -STORAGE_CONFIG = getattr(configuration, 'STORAGE_CONFIG', {}) +STORAGE_CONFIG = getattr(configuration, 'STORAGE_CONFIG', None) +STORAGES = getattr(configuration, 'STORAGES', {}) TIME_ZONE = getattr(configuration, 'TIME_ZONE', 'UTC') TRANSLATION_ENABLED = getattr(configuration, 'TRANSLATION_ENABLED', True) @@ -236,7 +236,7 @@ DATABASES = { # if STORAGE_BACKEND is not None: - if not CONFIG_STORAGES: + if not STORAGES: raise ImproperlyConfigured( "STORAGE_BACKEND and STORAGES are both set, remove the deprecated STORAGE_BACKEND setting." ) @@ -251,7 +251,7 @@ if STORAGE_CONFIG is not None: ) # Default STORAGES for Django -STORAGES = { +DEFAULT_STORAGES = { "default": { "BACKEND": "django.core.files.storage.FileSystemStorage", }, @@ -262,7 +262,7 @@ STORAGES = { "BACKEND": "extras.storage.ScriptFileSystemStorage", }, } -STORAGES.update(CONFIG_STORAGES) +STORAGES = DEFAULT_STORAGES | STORAGES # TODO: This code is deprecated and needs to be removed in the future if STORAGE_BACKEND is not None: