diff --git a/endpoints/api.py b/endpoints/api.py index d701b0e3f..cecc5ca20 100644 --- a/endpoints/api.py +++ b/endpoints/api.py @@ -1435,8 +1435,7 @@ def activate_build_trigger(namespace, repository, trigger_uuid): trigger.auth_token, new_config_dict) except TriggerActivationException as e: token.delete_instance() - abort(400, message = e.msg) - return + return request_error(message=e.message) # Save the updated config. trigger.config = json.dumps(final_config) diff --git a/static/js/controllers.js b/static/js/controllers.js index 5df6a3f95..4ceb17ab5 100644 --- a/static/js/controllers.js +++ b/static/js/controllers.js @@ -1449,8 +1449,9 @@ function RepoAdminCtrl($scope, Restangular, ApiService, KeyService, $routeParams ApiService.activateBuildTrigger(trigger['config'], params).then(function(resp) { trigger['is_active'] = true; }, function(resp) { + $scope.triggers.splice($scope.triggers.indexOf(trigger), 1); bootbox.dialog({ - "message": resp['message'] || 'The build trigger setup could not be completed', + "message": resp['data']['message'] || 'The build trigger setup could not be completed', "title": "Could not activate build trigger", "buttons": { "close": { diff --git a/static/partials/view-repo.html b/static/partials/view-repo.html index 20d393de0..1a7872354 100644 --- a/static/partials/view-repo.html +++ b/static/partials/view-repo.html @@ -34,7 +34,7 @@
  • - Build Triggers + Build Triggers