From c295651d8338ad6589b39f8c219091ab6fda9d5b Mon Sep 17 00:00:00 2001 From: eclipse Date: Wed, 16 Jul 2025 21:21:41 +0200 Subject: [PATCH] make applying config values more robust --- the_works/__init__.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/the_works/__init__.py b/the_works/__init__.py index 100651f..e1c6b24 100644 --- a/the_works/__init__.py +++ b/the_works/__init__.py @@ -15,11 +15,11 @@ def create_app(config=None): app.config['DEBUG_TB_INTERCEPT_REDIRECTS'] = False #DEBUG # use config from function parameter if present - if config is not None: - app.config.from_object(config) + if config: + app.config.update(config) # some #DEBUG output - print(f"Current Environment: {app.config['ENV']}") #DEBUG + print(f"Current Environment: {app.config['ENV'] if 'ENV' in app.config.keys() else 'ENV is not set'}") #DEBUG print(app.config) #DEBUG # initialize database