From 39f0054cd5b8144a7e1241a4f50da1d9bd1de651 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?L=C3=AA=20Ho=C3=A0ng=20Nam?= Date: Mon, 3 Nov 2025 17:14:38 +0700 Subject: [PATCH] code (#10751) Co-authored-by: Le Hoang Nam --- src/backend/InvenTree/InvenTree/settings.py | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/src/backend/InvenTree/InvenTree/settings.py b/src/backend/InvenTree/InvenTree/settings.py index e507427faa..18229b242f 100644 --- a/src/backend/InvenTree/InvenTree/settings.py +++ b/src/backend/InvenTree/InvenTree/settings.py @@ -265,13 +265,9 @@ DBBACKUP_EMAIL_SUBJECT_PREFIX = InvenTree.backup.backup_email_prefix() DBBACKUP_CONNECTORS = {'default': InvenTree.backup.get_backup_connector_options()} # Data storage options -STORAGES = { - 'default': {'BACKEND': 'django.core.files.storage.FileSystemStorage'}, - 'staticfiles': {'BACKEND': 'django.contrib.staticfiles.storage.StaticFilesStorage'}, - 'dbbackup': { - 'BACKEND': InvenTree.backup.get_backup_storage_backend(), - 'OPTIONS': InvenTree.backup.get_backup_storage_options(), - }, +DBBACKUP_STORAGE_CONFIG = { + 'BACKEND': InvenTree.backup.get_backup_storage_backend(), + 'OPTIONS': InvenTree.backup.get_backup_storage_options(), } # Enable django admin interface? @@ -1567,6 +1563,8 @@ if SITE_URL and not TESTING: # pragma: no cover # Storage backends STORAGE_TARGET, STORAGES, _media = storages.init_storages() +if 'dbbackup' not in STORAGES: + STORAGES['dbbackup'] = DBBACKUP_STORAGE_CONFIG if _media: MEDIA_URL = _media PRESIGNED_URL_EXPIRATION = 600