File tree Expand file tree Collapse file tree 2 files changed +6
-2
lines changed Expand file tree Collapse file tree 2 files changed +6
-2
lines changed Original file line number Diff line number Diff line change @@ -39,7 +39,8 @@ def get_credentials(event=None):
39
39
:return: Stripe secret and publishable keys.
40
40
"""
41
41
if not event :
42
- settings = get_settings ()
42
+ # Perform refresh from db to make sure Stripe keys are retrieved
43
+ settings = get_settings (from_db = True )
43
44
if (
44
45
settings ['app_environment' ] == 'development'
45
46
and settings ['stripe_test_secret_key' ]
Original file line number Diff line number Diff line change @@ -11,8 +11,11 @@ def get_settings(from_db=False):
11
11
"""
12
12
if not from_db and 'custom_settings' in current_app .config :
13
13
return current_app .config ['custom_settings' ]
14
- s = Setting . query . order_by ( desc ( Setting . id )). first ()
14
+
15
15
app_environment = current_app .config .get ('ENV' , 'production' )
16
+ # query environment based on initial config applied at start for Flask app
17
+ s = Setting .query .filter (Setting .app_environment == app_environment ).first ()
18
+
16
19
if s is None :
17
20
set_settings (app_name = 'Open Event' , app_environment = app_environment )
18
21
else :
You can’t perform that action at this time.
0 commit comments