diff --git a/app/docker/views/stacks/create/createStackController.js b/app/docker/views/stacks/create/createStackController.js index 18c32be8f..711e3c1c7 100644 --- a/app/docker/views/stacks/create/createStackController.js +++ b/app/docker/views/stacks/create/createStackController.js @@ -83,14 +83,11 @@ function ($scope, $state, StackService, Authentication, Notifications, FormValid $scope.state.actionInProgress = true; createStack(name, method) .then(function success(data) { + return ResourceControlService.applyResourceControl('stack', name, userId, accessControlData, []); + }) + .then(function success() { Notifications.success('Stack successfully deployed'); - return ResourceControlService.applyResourceControl('stack', name, userId, accessControlData, []) - .then(function success() { - $state.go('docker.stacks'); - }) - .catch(function error(err) { - Notifications.error('Failure', err, 'Unable to apply resource control on the stack'); - }); + $state.go('docker.stacks'); }) .catch(function error(err) { Notifications.warning('Deployment error', err.err.data.err); diff --git a/app/docker/views/templates/templatesController.js b/app/docker/views/templates/templatesController.js index 68f7e2914..b050fc6df 100644 --- a/app/docker/views/templates/templatesController.js +++ b/app/docker/views/templates/templatesController.js @@ -115,14 +115,11 @@ function ($scope, $q, $state, $transition$, $anchorScroll, $filter, ContainerSer StackService.createStackFromGitRepository(stackName, repositoryOptions, template.Env) .then(function success(data) { + return ResourceControlService.applyResourceControl('stack', stackName, userId, accessControlData, []); + }) + .then(function success() { Notifications.success('Stack successfully deployed'); - ResourceControlService.applyResourceControl('stack', stackName, userId, accessControlData, []) - .then(function success() { - $state.go('docker.stacks'); - }) - .catch(function error(err) { - Notifications.error('Failure', err, 'Unable to apply resource control on the stack'); - }); + $state.go('docker.stacks'); }) .catch(function error(err) { Notifications.warning('Deployment error', err.err.data.err);