diff --git a/awx/ui/static/js/controllers/Teams.js b/awx/ui/static/js/controllers/Teams.js index 1ee97e649b..fccae68a36 100644 --- a/awx/ui/static/js/controllers/Teams.js +++ b/awx/ui/static/js/controllers/Teams.js @@ -202,19 +202,25 @@ export function TeamsEdit($scope, $rootScope, $compile, $location, $log, $routeP } $scope.teamLoadedRemove = $scope.$on('teamLoaded', function () { CheckAccess({ scope: $scope }); - Rest.setUrl($scope.organization_url); - Rest.get() - .success(function (data) { - $scope.organization_name = data.name; - master.organization_name = data.name; - Wait('stop'); - }) - .error(function (data, status) { - ProcessErrors($scope, data, status, null, { hdr: 'Error!', msg: 'Failed to retrieve organization: ' + - $scope.orgnization_url + '. GET status: ' + status }); - }); - for (var set in relatedSets) { - $scope.search(relatedSets[set].iterator); + if ($scope.organization_url) { + Rest.setUrl($scope.organization_url); + Rest.get() + .success(function (data) { + $scope.organization_name = data.name; + master.organization_name = data.name; + Wait('stop'); + }) + .error(function (data, status) { + ProcessErrors($scope, data, status, null, { hdr: 'Error!', msg: 'Failed to retrieve organization: ' + + $scope.orgnization_url + '. GET status: ' + status }); + }); + for (var set in relatedSets) { + $scope.search(relatedSets[set].iterator); + } + } else { + $scope.organization_name = ""; + master.organization_name = ""; + Wait('stop'); } }); @@ -387,4 +393,4 @@ export function TeamsEdit($scope, $rootScope, $compile, $location, $log, $routeP TeamsEdit.$inject = ['$scope', '$rootScope', '$compile', '$location', '$log', '$routeParams', 'TeamForm', 'GenerateForm', 'Rest', 'Alert', 'ProcessErrors', 'LoadBreadCrumbs', 'RelatedSearchInit', 'RelatedPaginateInit', 'ReturnToCaller', 'ClearScope', 'LookUpInit', 'Prompt', 'GetBasePath', 'CheckAccess', 'OrganizationList', 'Wait', 'Stream' -]; \ No newline at end of file +];