mirror of
https://github.com/apache/superset.git
synced 2024-09-16 02:29:39 -04:00
fix: Ensure consistent naming for testconn (#11246)
Co-authored-by: John Bodley <john.bodley@airbnb.com>
This commit is contained in:
parent
88af85ac53
commit
51fec1ab16
@ -41,12 +41,12 @@
|
|||||||
uri: $.trim($("#sqlalchemy_uri").val()),
|
uri: $.trim($("#sqlalchemy_uri").val()),
|
||||||
name: $('#database_name').val(),
|
name: $('#database_name').val(),
|
||||||
impersonate_user: $('#impersonate_user').is(':checked'),
|
impersonate_user: $('#impersonate_user').is(':checked'),
|
||||||
extras: extra ? JSON.parse(extra) : {},
|
extra: extra ? JSON.parse(extra) : {},
|
||||||
encrypted_extra: encryptedExtra ? JSON.parse(encryptedExtra) : {},
|
encrypted_extra: encryptedExtra ? JSON.parse(encryptedExtra) : {},
|
||||||
server_cert: $("#server_cert").val(),
|
server_cert: $("#server_cert").val(),
|
||||||
})
|
})
|
||||||
} catch(parse_error){
|
} catch(parse_error){
|
||||||
alert("Malformed JSON in the extras field: " + parse_error);
|
alert("Malformed JSON in the extra fields: " + parse_error);
|
||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1135,12 +1135,11 @@ class Superset(BaseSupersetView): # pylint: disable=too-many-public-methods
|
|||||||
if existing_database and uri == existing_database.safe_sqlalchemy_uri():
|
if existing_database and uri == existing_database.safe_sqlalchemy_uri():
|
||||||
uri = existing_database.sqlalchemy_uri_decrypted
|
uri = existing_database.sqlalchemy_uri_decrypted
|
||||||
|
|
||||||
# this is the database instance that will be tested
|
# This is the database instance that will be tested. Note the extra fields
|
||||||
|
# are represented as JSON encoded strings in the model.
|
||||||
database = models.Database(
|
database = models.Database(
|
||||||
# extras is sent as json, but required to be a string in the Database
|
|
||||||
# model
|
|
||||||
server_cert=request.json.get("server_cert"),
|
server_cert=request.json.get("server_cert"),
|
||||||
extra=json.dumps(request.json.get("extras", {})),
|
extra=json.dumps(request.json.get("extra", {})),
|
||||||
impersonate_user=request.json.get("impersonate_user"),
|
impersonate_user=request.json.get("impersonate_user"),
|
||||||
encrypted_extra=json.dumps(request.json.get("encrypted_extra", {})),
|
encrypted_extra=json.dumps(request.json.get("encrypted_extra", {})),
|
||||||
)
|
)
|
||||||
|
Loading…
Reference in New Issue
Block a user