From f194551afcecb5b916e7f4bd0298656b6564cac6 Mon Sep 17 00:00:00 2001 From: Kyle Spearrin Date: Fri, 19 May 2017 20:30:25 -0400 Subject: [PATCH] seat check when signing up --- src/Core/Services/Implementations/OrganizationService.cs | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/Core/Services/Implementations/OrganizationService.cs b/src/Core/Services/Implementations/OrganizationService.cs index 3b36986c6..68189d9ce 100644 --- a/src/Core/Services/Implementations/OrganizationService.cs +++ b/src/Core/Services/Implementations/OrganizationService.cs @@ -486,6 +486,11 @@ namespace Bit.Core.Services StripeCustomer customer = null; StripeSubscription subscription = null; + if(plan.BaseSeats + signup.AdditionalSeats <= 0) + { + throw new BadRequestException("You do not have any seats!"); + } + if(!plan.CanBuyAdditionalSeats && signup.AdditionalSeats > 0) { throw new BadRequestException("Plan does not allow additional users.");