superset-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From maximebeauche...@apache.org
Subject [incubator-superset] branch master updated: Allowing Leading and Trailing spaces in connection (#3433)
Date Wed, 08 Nov 2017 06:13:20 GMT
This is an automated email from the ASF dual-hosted git repository.

maximebeauchemin pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-superset.git


The following commit(s) were added to refs/heads/master by this push:
     new 0280bc5  Allowing Leading and Trailing spaces in connection (#3433)
0280bc5 is described below

commit 0280bc52e0e1ec08e223de79e923b9477a50489b
Author: Ishpreet Singh <ishpreetsingh2808@gmail.com>
AuthorDate: Wed Nov 8 11:43:18 2017 +0530

    Allowing Leading and Trailing spaces in connection (#3433)
---
 superset/models/core.py                                 | 2 +-
 superset/templates/superset/models/database/macros.html | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/superset/models/core.py b/superset/models/core.py
index 0358209..d2ca844 100644
--- a/superset/models/core.py
+++ b/superset/models/core.py
@@ -596,7 +596,7 @@ class Database(Model, AuditMixinNullable):
         return url_copy
 
     def set_sqlalchemy_uri(self, uri):
-        conn = sqla.engine.url.make_url(uri)
+        conn = sqla.engine.url.make_url(uri.strip())
         if conn.password != PASSWORD_MASK and not self.custom_password_store:
             # do not over-write the password with the password mask
             self.password = conn.password
diff --git a/superset/templates/superset/models/database/macros.html b/superset/templates/superset/models/database/macros.html
index ec20da1..32972bc 100644
--- a/superset/templates/superset/models/database/macros.html
+++ b/superset/templates/superset/models/database/macros.html
@@ -18,7 +18,7 @@
       var data = {};
       try{
         data = JSON.stringify({
-          uri: $("#sqlalchemy_uri").val(),
+          uri: $.trim($("#sqlalchemy_uri").val()),
           name: $('#database_name').val(),
           impersonate_user: $('#impersonate_user').is(':checked'),
           extras: JSON.parse($("#extra").val()),

-- 
To stop receiving notification emails like this one, please contact
['"commits@superset.apache.org" <commits@superset.apache.org>'].

Mime
View raw message