[config] restore dumped configuration when using HALFAPI_DOMAIN_NAME

This commit is contained in:
maxime 2022-06-23 15:33:19 +02:00
parent f96c712aa8
commit 3c97d39cdc
1 changed files with 9 additions and 0 deletions

View File

@ -97,6 +97,13 @@ PROJECT_NAME = CONFIG.get('project_name',
if environ.get('HALFAPI_DOMAIN_NAME'): if environ.get('HALFAPI_DOMAIN_NAME'):
DOMAIN_NAME = 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'] = {}
CONFIG['domain'][DOMAIN_NAME] = { CONFIG['domain'][DOMAIN_NAME] = {
@ -105,6 +112,8 @@ if environ.get('HALFAPI_DOMAIN_NAME'):
'prefix': False 'prefix': False
} }
CONFIG['domain'][DOMAIN_NAME]['config'] = domain_config
if environ.get('HALFAPI_DOMAIN_MODULE'): if environ.get('HALFAPI_DOMAIN_MODULE'):
dom_module = environ.get('HALFAPI_DOMAIN_MODULE') dom_module = environ.get('HALFAPI_DOMAIN_MODULE')
CONFIG['domain'][DOMAIN_NAME]['module'] = dom_module CONFIG['domain'][DOMAIN_NAME]['module'] = dom_module