@cryptotaxi247 / CoPilot / commits / 07206e34

fix: skip license check for the first customer in MSSP license validation (#402)

taylor_socfortress committed Jan 30, 2025 at 12:10 UTC 07206e3419bf3c4bf31dc0ee41c78e1859ef4448
1 file changed +5
backend/app/customers/routes/customers.py
+5
@@ -137,6 +137,7 @@ async def verify_unique_customer_code(
137 async def mssp_license_check(session: AsyncSession):
138 """
139 Check if the current number of provisioned customers is within the allowed range based on the MSSP license type.
140 + - First customer is free (no license check)
141 - MSSP Unlimited: No limit
142 - MSSP 10: Up to 10 customers (0-9 current customers)
143 - MSSP 5: Up to 5 customers (0-4 current customers)
@@ -147,6 +148,10 @@ async def mssp_license_check(session: AsyncSession):
148 provisioned_customers = len(customers)
149 logger.info(f"Provisioned customers: {provisioned_customers}")
150
151 + # Skip license check for first customer
152 + if provisioned_customers == 0:
153 + return
154 +
155 error_message = "You have reached the maximum number of customers allowed for your license type. Please upgrade your license to provision more customers."
156
157 # Try most permissive license first