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):
3939 :return: Stripe secret and publishable keys.
4040 """
4141 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 )
4344 if (
4445 settings ['app_environment' ] == 'development'
4546 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):
1111 """
1212 if not from_db and 'custom_settings' in current_app .config :
1313 return current_app .config ['custom_settings' ]
14- s = Setting . query . order_by ( desc ( Setting . id )). first ()
14+
1515 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+
1619 if s is None :
1720 set_settings (app_name = 'Open Event' , app_environment = app_environment )
1821 else :
You can’t perform that action at this time.
0 commit comments