From 7a6fb7554dd9cceff2fe7d68af7d834e8e06ca3d Mon Sep 17 00:00:00 2001 From: Joseph Schorr Date: Mon, 17 Oct 2016 21:39:22 -0400 Subject: [PATCH] Only attempt to load the license for the setup tool once there is a valid user Prevents the 401 session expired box from appearing --- static/js/core-config-setup.js | 8 ++++++-- test/test_api_security.py | 1 + 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/static/js/core-config-setup.js b/static/js/core-config-setup.js index ccc7317af..19977d359 100644 --- a/static/js/core-config-setup.js +++ b/static/js/core-config-setup.js @@ -1257,7 +1257,7 @@ angular.module("core-config-setup", ['angularFileUpload']) restrict: 'C', scope: { }, - controller: function($scope, $element, ApiService) { + controller: function($scope, $element, ApiService, UserService) { $scope.state = 'loading-license'; $scope.showingEditor = false; $scope.requiredBox = ''; @@ -1276,7 +1276,11 @@ angular.module("core-config-setup", ['angularFileUpload']) }); }; - loadLicense(); + UserService.updateUserIn($scope, function(user) { + if (!user.anonymous) { + loadLicense(); + } + }); $scope.showEditor = function($event) { $event.preventDefault(); diff --git a/test/test_api_security.py b/test/test_api_security.py index c31e771af..550707e55 100644 --- a/test/test_api_security.py +++ b/test/test_api_security.py @@ -52,6 +52,7 @@ from endpoints.api.superuser import (SuperUserLogs, SuperUserList, SuperUserMana SuperUserAggregateLogs, SuperUserServiceKeyManagement, SuperUserServiceKey, SuperUserServiceKeyApproval, SuperUserTakeOwnership, SuperUserMessages, SuperUserLicense) +from endpoints.api.globalmessages import GlobalUserMessage, GlobalUserMessages from endpoints.api.secscan import RepositoryImageSecurity from endpoints.api.manifest import RepositoryManifestLabels, ManageRepositoryManifestLabel