From bc7d0ffad2e565827aa0dc7d54293a91ee107236 Mon Sep 17 00:00:00 2001 From: Dennis O'Brien Date: Thu, 22 Sep 2016 08:17:05 -0700 Subject: [PATCH] Fix TEST CONNECTION on a newly added database. (#1168) This addresses issue #1167 If the database name passed in the request is not found in the db, test using the sqlalchemy uri passed. --- caravel/views.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/caravel/views.py b/caravel/views.py index 563db9f224..061e719d58 100755 --- a/caravel/views.py +++ b/caravel/views.py @@ -1270,7 +1270,7 @@ class Caravel(BaseCaravelView): .filter_by(database_name=db_name) .first() ) - if uri == database.safe_sqlalchemy_uri(): + if database and uri == database.safe_sqlalchemy_uri(): # the password-masked uri was passed # use the URI associated with this database uri = database.sqlalchemy_uri_decrypted