Skip to content

Commit

Permalink
fixes #20026 - gpg keys for repo discovery
Browse files Browse the repository at this point in the history
  • Loading branch information
thomasmckay committed Jun 26, 2017
1 parent 1d4d7c0 commit 728016d
Showing 1 changed file with 9 additions and 11 deletions.
Expand Up @@ -17,8 +17,8 @@
* repository discovery.
*/
angular.module('Bastion.products').controller('DiscoveryCreateController',
['$scope', '$q', 'CurrentOrganization', 'Product', 'Repository', 'GPGKey', 'FormUtils', 'DiscoveryRepositories', 'translate',
function ($scope, $q, CurrentOrganization, Product, Repository, GPGKey, FormUtils, DiscoveryRepositories, translate) {
['$scope', '$q', 'CurrentOrganization', 'Product', 'Repository', 'GPGKey', 'FormUtils', 'DiscoveryRepositories', 'translate', 'ApiErrorHandler',
function ($scope, $q, CurrentOrganization, Product, Repository, GPGKey, FormUtils, DiscoveryRepositories, translate, ApiErrorHandler) {

$scope.errorMessages = [];
$scope.successMessages = [];
Expand Down Expand Up @@ -172,15 +172,13 @@ angular.module('Bastion.products').controller('DiscoveryCreateController',
return fieldsEnabled;
};

$scope.gpgKeys = function () {
var deferred = $q.defer();

GPGKey.queryUnpaged(function (response) {
deferred.resolve(response.results);
});

return deferred.promise;
};
$scope.gpgKeys = [];
GPGKey.queryUnpaged(function (gpgKeys) {
$scope.gpgKeys = gpgKeys.results;
}, function (response) {
$scope.gpgKeys = [];
ApiErrorHandler.handleGETRequestErrors(response, $scope);
});

$scope.$watch('table.rows', function (newList, oldList) {
if (newList) {
Expand Down

0 comments on commit 728016d

Please sign in to comment.