From 3c97d39cdceeda4b2a18ca85597f2c8e7a521c6e Mon Sep 17 00:00:00 2001 From: maxime Date: Thu, 23 Jun 2022 15:33:19 +0200 Subject: [PATCH] [config] restore dumped configuration when using HALFAPI_DOMAIN_NAME --- halfapi/conf.py | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/halfapi/conf.py b/halfapi/conf.py index 8dac7d4..3a57aff 100644 --- a/halfapi/conf.py +++ b/halfapi/conf.py @@ -97,6 +97,13 @@ PROJECT_NAME = CONFIG.get('project_name', if environ.get('HALFAPI_DOMAIN_NAME'): DOMAIN_NAME = environ.get('HALFAPI_DOMAIN_NAME') + if 'domain' in CONFIG and DOMAIN_NAME in CONFIG['domain'] \ + and 'config' in CONFIG['domain'][DOMAIN_NAME]: + + domain_config = CONFIG['domain'][DOMAIN_NAME]['config'] + else: + domain_config = {} + CONFIG['domain'] = {} CONFIG['domain'][DOMAIN_NAME] = { @@ -105,6 +112,8 @@ if environ.get('HALFAPI_DOMAIN_NAME'): 'prefix': False } + CONFIG['domain'][DOMAIN_NAME]['config'] = domain_config + if environ.get('HALFAPI_DOMAIN_MODULE'): dom_module = environ.get('HALFAPI_DOMAIN_MODULE') CONFIG['domain'][DOMAIN_NAME]['module'] = dom_module