diff --git a/superset/templates/superset/models/database/macros.html b/superset/templates/superset/models/database/macros.html index ae67e4b78f728..f1d07220ef523 100644 --- a/superset/templates/superset/models/database/macros.html +++ b/superset/templates/superset/models/database/macros.html @@ -22,7 +22,7 @@ .append(''); $("#testconn").click(function(e) { e.preventDefault(); - var url = "/superset/testconn"; + var url = "/api/v1/database/test_connection"; var csrf_token = "{{ csrf_token() if csrf_token else '' }}"; $.ajaxSetup({ diff --git a/superset/views/core.py b/superset/views/core.py index 8fd50bb184e2b..5dc8b6e5abc79 100755 --- a/superset/views/core.py +++ b/superset/views/core.py @@ -1333,6 +1333,11 @@ def add_slices( # pylint: disable=no-self-use @expose("/testconn", methods=["POST", "GET"]) def testconn(self) -> FlaskResponse: # pylint: disable=no-self-use """Tests a sqla connection""" + logger.warning( + "%s.testconn " + "This API endpoint is deprecated and will be removed in version 3.0.0", + self.__class__.__name__, + ) db_name = request.json.get("name") uri = request.json.get("uri") try: