Skip to content

Commit

Permalink
Fix TEST CONNECTION on a newly added database. (#1168)
Browse files Browse the repository at this point in the history
This addresses issue #1167
If the database name passed in the request is not found in the db, test using the sqlalchemy uri passed.
  • Loading branch information
dennisobrien authored and mistercrunch committed Sep 22, 2016
1 parent 2f2ed22 commit bc7d0ff
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion caravel/views.py
Expand Up @@ -1270,7 +1270,7 @@ def testconn(self):
.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
Expand Down

0 comments on commit bc7d0ff

Please sign in to comment.