From ac72a8d86dc746b54cd7abf8b0c051ee1ed23a97 Mon Sep 17 00:00:00 2001 From: yackob03 Date: Tue, 5 Nov 2013 14:47:48 -0500 Subject: [PATCH] Pass whether an orgazanition is creating the plan to the plan service to calculate the next minimum plan. --- static/js/controllers.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/static/js/controllers.js b/static/js/controllers.js index c17787df3..5d86bd6ab 100644 --- a/static/js/controllers.js +++ b/static/js/controllers.js @@ -981,7 +981,7 @@ function NewRepoCtrl($scope, $location, $http, $timeout, UserService, Restangula var privateAllowed = $scope.subscription.usedPrivateRepos < $scope.subscribedPlan.privateRepos; if (!privateAllowed) { // If not, find the minimum repository that does. - PlanService.getMinimumPlan($scope.subscription.usedPrivateRepos + 1, function(minimum) { + PlanService.getMinimumPlan($scope.subscription.usedPrivateRepos + 1, !$scope.isUserNamespace, function(minimum) { $scope.planRequired = minimum; }); } @@ -1045,6 +1045,7 @@ function NewRepoCtrl($scope, $location, $http, $timeout, UserService, Restangula // Watch the namespace on the repo. If it changes, we update the plan and the public/private // accordingly. + $scope.isUserNamespace = true; $scope.$watch('repo.namespace', function(namespace) { // Note: Can initially be undefined. if (!namespace) { return; } @@ -1058,7 +1059,7 @@ function NewRepoCtrl($scope, $location, $http, $timeout, UserService, Restangula // Load the user's subscription information in case they want to create a private // repository. UserService.getCurrentSubscription(subscribedToPlan, function() { - PlanService.getMinimumPlan(1, function(minimum) { $scope.planRequired = minimum; }); + PlanService.getMinimumPlan(1, false, function(minimum) { $scope.planRequired = minimum; }); }); } else { $scope.planRequired = null;