From bf320f038b27e999eb083f0b1415d8530159eed6 Mon Sep 17 00:00:00 2001 From: Feanil Patel Date: Thu, 9 Apr 2020 15:18:57 -0400 Subject: [PATCH] Find more vars that are partially updated. --- cms/envs/production.py | 17 +++++++++++++---- lms/envs/production.py | 17 +++++++++++++---- 2 files changed, 26 insertions(+), 8 deletions(-) diff --git a/cms/envs/production.py b/cms/envs/production.py index 75e4d73a75..98fee62bf8 100644 --- a/cms/envs/production.py +++ b/cms/envs/production.py @@ -47,11 +47,20 @@ with codecs.open(CONFIG_FILE, encoding='utf-8') as f: # Add the key/values from config into the global namespace of this module. # But don't override the FEATURES dict because we do that in an additive way. __config_copy__ = copy.deepcopy(__config__) - if 'FEATURES' in __config_copy__: - del __config_copy__['FEATURES'] - if 'EVENT_TRACKING_BACKENDS' in __config_copy__: - del __config_copy__['EVENT_TRACKING_BACKENDS'] + KEYS_WITH_MERGED_VALUES = [ + 'FEATURES', + 'TRACKING_BACKENDS', + 'EVENT_TRACKING_BACKENDS', + 'JWT_AUTH', + 'CELERY_QUEUES', + 'MKTG_URL_LINK_MAP', + 'MKTG_URL_OVERRIDES', + ] + for key in KEYS_WITH_MERGED_VALUES: + if key in __config_copy__: + del __config_copy__[key] + vars().update(__config_copy__) diff --git a/lms/envs/production.py b/lms/envs/production.py index c7fc40ade2..c8a1164db2 100644 --- a/lms/envs/production.py +++ b/lms/envs/production.py @@ -59,11 +59,20 @@ with codecs.open(CONFIG_FILE, encoding='utf-8') as f: # Add the key/values from config into the global namespace of this module. # But don't override the FEATURES dict because we do that in an additive way. __config_copy__ = copy.deepcopy(__config__) - if 'FEATURES' in __config_copy__: - del __config_copy__['FEATURES'] - if 'EVENT_TRACKING_BACKENDS' in __config_copy__: - del __config_copy__['EVENT_TRACKING_BACKENDS'] + KEYS_WITH_MERGED_VALUES = [ + 'FEATURES', + 'TRACKING_BACKENDS', + 'EVENT_TRACKING_BACKENDS', + 'JWT_AUTH', + 'CELERY_QUEUES', + 'MKTG_URL_LINK_MAP', + 'MKTG_URL_OVERRIDES', + ] + for key in KEYS_WITH_MERGED_VALUES: + if key in __config_copy__: + del __config_copy__[key] + vars().update(__config_copy__)