From d65fbd3596ffdec5e7fa476e322925c7389f5489 Mon Sep 17 00:00:00 2001 From: Shauna Gordon-McKeon Date: Fri, 17 Dec 2021 15:17:33 -0500 Subject: [PATCH] Metagov core version detects whether or not to use httpwrapper version --- metagov/metagov/core/utils.py | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/metagov/metagov/core/utils.py b/metagov/metagov/core/utils.py index 6c373d63..5abacbda 100644 --- a/metagov/metagov/core/utils.py +++ b/metagov/metagov/core/utils.py @@ -145,8 +145,17 @@ def get_plugin_instance(plugin_name, community, community_platform_id=None): def get_configuration(config_name, **kwargs): + + # if multi driver functionality is on, use httpwrapper's version of get_configuration + from django.conf import settings + if hasattr(settings, "MULTI_DRIVER") and settings.MULTI_DRIVER: + from metagov.httpwrapper.utils import get_configuration as multidriver_get_configuration + return multidriver_get_configuration(config_name, **kwargs) + + # otherwise just get from environment from metagov.settings import TESTING default_val = TESTING if TESTING else None + return env(config_name, default=default_val)