From 4f8a86b3fe636863a9044dbde97502981a305ee3 Mon Sep 17 00:00:00 2001 From: Jared Tabor Date: Fri, 8 Aug 2014 16:07:36 -0400 Subject: [PATCH] fixed issue with deleting a project and then trying to add a new one in the job template page --- awx/ui/static/js/controllers/JobTemplates.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/awx/ui/static/js/controllers/JobTemplates.js b/awx/ui/static/js/controllers/JobTemplates.js index 03bdceab23..aa967d330c 100644 --- a/awx/ui/static/js/controllers/JobTemplates.js +++ b/awx/ui/static/js/controllers/JobTemplates.js @@ -252,7 +252,7 @@ function JobTemplatesAdd($scope, $rootScope, $compile, $location, $log, $routePa if ($scope.selectPlaybookUnregister) { $scope.selectPlaybookUnregister(); } - $scope.selectPlaybookUnregister = $scope.$watch('project_name', function (oldval, newval) { + $scope.selectPlaybookUnregister = $scope.$watch('project_name', function (newval, oldval) { selectPlaybook(oldval, newval); checkSCMStatus(oldval, newval); }); @@ -467,7 +467,7 @@ function JobTemplatesEdit($scope, $rootScope, $compile, $location, $log, $routeP if ($scope.watchProjectUnregister) { $scope.watchProjectUnregister(); } - $scope.watchProjectUnregister = $scope.$watch('project_name', function (oldValue, newValue) { + $scope.watchProjectUnregister = $scope.$watch('project_name', function (newValue, oldValue) { if (oldValue !== newValue && newValue !== '' && newValue !== null && newValue !== undefined) { $scope.playbook = null; getPlaybooks($scope.project);