From 3ddbb6a6cd9e85f5d81f845ce5ef564db5091a7c Mon Sep 17 00:00:00 2001 From: Oliver Walters Date: Tue, 30 Mar 2021 20:53:26 +1100 Subject: [PATCH] Check for empty values --- InvenTree/InvenTree/settings.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/InvenTree/InvenTree/settings.py b/InvenTree/InvenTree/settings.py index 73a38b484d..2822202f13 100644 --- a/InvenTree/InvenTree/settings.py +++ b/InvenTree/InvenTree/settings.py @@ -362,6 +362,10 @@ else: # Extract database configuration from the config.yaml file db_config = CONFIG.get('database', {}) + # Default action if db_config not specified in yaml file + if not db_config: + db_config = {} + # If a particular database option is not specified in the config file, # look for it in the environmental variables # e.g. INVENTREE_DB_NAME / INVENTREE_DB_USER / etc