From 4bc4f2e6562432025deb72dccc129fb07493d97a Mon Sep 17 00:00:00 2001 From: iamareebjamal Date: Thu, 20 Jun 2019 12:05:13 +0530 Subject: [PATCH 1/2] fix: Honor environment set from .env --- app/settings/__init__.py | 5 +++-- config.py | 1 + 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/app/settings/__init__.py b/app/settings/__init__.py index 96d9c04848..09913aecea 100644 --- a/app/settings/__init__.py +++ b/app/settings/__init__.py @@ -13,12 +13,13 @@ def get_settings(from_db=False): if not from_db and 'custom_settings' in current_app.config: return current_app.config['custom_settings'] s = Setting.query.order_by(desc(Setting.id)).first() + app_environment = current_app.config.get('ENV', 'production') if s is None: - set_settings(secret='super secret key', app_name='Open Event') + set_settings(secret='super secret key', app_name='Open Event', app_environment=app_environment) else: current_app.config['custom_settings'] = make_dict(s) if not current_app.config['custom_settings'].get('secret'): - set_settings(secret='super secret key', app_name='Open Event') + set_settings(secret='super secret key', app_name='Open Event', app_environment=app_environment) return current_app.config['custom_settings'] diff --git a/config.py b/config.py index dc7d3f2f6a..58afe43607 100644 --- a/config.py +++ b/config.py @@ -131,6 +131,7 @@ class TestingConfig(Config): ENV = 'testing' TESTING = True + DEBUG = True CELERY_ALWAYS_EAGER = True CELERY_EAGER_PROPAGATES_EXCEPTIONS = True SQLALCHEMY_RECORD_QUERIES = True From 567008c5f4ac4214082d2ad952b9dd4f318a7d83 Mon Sep 17 00:00:00 2001 From: Areeb Jamal Date: Thu, 20 Jun 2019 12:38:53 +0530 Subject: [PATCH 2/2] Update config.py --- config.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/config.py b/config.py index 58afe43607..78e9231d9b 100644 --- a/config.py +++ b/config.py @@ -131,8 +131,7 @@ class TestingConfig(Config): ENV = 'testing' TESTING = True - DEBUG = True - CELERY_ALWAYS_EAGER = True + CELERY_TASK_ALWAYS_EAGER = True CELERY_EAGER_PROPAGATES_EXCEPTIONS = True SQLALCHEMY_RECORD_QUERIES = True DEBUG_TB_ENABLED = False