From d11f254476a12397b15be4a67433765b95d23358 Mon Sep 17 00:00:00 2001 From: kevgliss Date: Thu, 17 Nov 2016 12:16:30 -0800 Subject: [PATCH] Closes: #469 (#510) --- .../authorities/authority/authority.js | 28 +++++++++---------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/lemur/static/app/angular/authorities/authority/authority.js b/lemur/static/app/angular/authorities/authority/authority.js index 6f038dd6..9863bf4d 100644 --- a/lemur/static/app/angular/authorities/authority/authority.js +++ b/lemur/static/app/angular/authorities/authority/authority.js @@ -37,7 +37,20 @@ angular.module('lemur') .controller('AuthorityCreateController', function ($scope, $uibModalInstance, AuthorityService, AuthorityApi, LemurRestangular, RoleService, PluginService, WizardHandler, toaster) { $scope.authority = LemurRestangular.restangularizeElement(null, {}, 'authorities'); // set the defaults - AuthorityService.getDefaults($scope.authority); + AuthorityService.getDefaults($scope.authority).then(function () { + PluginService.getByType('issuer').then(function (plugins) { + $scope.plugins = plugins; + if ($scope.authority.defaultIssuerPlugin) { + plugins.forEach(function(plugin) { + if (plugin.slug === $scope.authority.defaultIssuerPlugin) { + $scope.authority.plugin = plugin; + } + }); + } else { + $scope.authority.plugin = plugins[0]; + } + }); + }); $scope.getAuthoritiesByName = function (value) { return AuthorityService.findAuthorityByName(value).then(function (authorities) { @@ -71,19 +84,6 @@ angular.module('lemur') }); }; - PluginService.getByType('issuer').then(function (plugins) { - $scope.plugins = plugins; - if ($scope.authority.defaultIssuerPlugin) { - plugins.forEach(function(plugin) { - if (plugin.slug === $scope.authority.defaultIssuerPlugin) { - $scope.authority.plugin = plugin; - } - }); - } else { - $scope.authority.plugin = plugins[0]; - } - }); - $scope.roleService = RoleService; $scope.authorityService = AuthorityService;