Commit 7806da11 by Torkel Ödegaard

Fixed issue with test data source connection and direct access, Fixes #2219

parent ec98f918
...@@ -58,7 +58,7 @@ function (angular, config) { ...@@ -58,7 +58,7 @@ function (angular, config) {
}; };
$scope.updateFrontendSettings = function() { $scope.updateFrontendSettings = function() {
backendSrv.get('/api/frontend/settings').then(function(settings) { return backendSrv.get('/api/frontend/settings').then(function(settings) {
config.datasources = settings.datasources; config.datasources = settings.datasources;
config.defaultDatasource = settings.defaultDatasource; config.defaultDatasource = settings.defaultDatasource;
datasourceSrv.init(); datasourceSrv.init();
...@@ -101,12 +101,13 @@ function (angular, config) { ...@@ -101,12 +101,13 @@ function (angular, config) {
if ($scope.current.id) { if ($scope.current.id) {
return backendSrv.put('/api/datasources/' + $scope.current.id, $scope.current).then(function() { return backendSrv.put('/api/datasources/' + $scope.current.id, $scope.current).then(function() {
$scope.updateFrontendSettings(); $scope.updateFrontendSettings().then(function() {
if (test) { if (test) {
$scope.testDatasource(); $scope.testDatasource();
} else { } else {
$location.path('datasources'); $location.path('datasources');
} }
});
}); });
} else { } else {
return backendSrv.post('/api/datasources', $scope.current).then(function(result) { return backendSrv.post('/api/datasources', $scope.current).then(function(result) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment