From bd969de2087f63e58c1d70771cd022ca6d4bde8b Mon Sep 17 00:00:00 2001 From: Prakhar Pratyush Date: Thu, 7 Mar 2024 16:52:57 +0530 Subject: [PATCH] stripe: Don't invoice fixed-price plans for additional licenses. Earlier, the code block to calculate additional licenses charge raised assertion error when processing a fixed-price plan. The code block shouldn't be executed for fixed-price plans as we don't charge customers on fixed-price plans for additional licenses. --- corporate/lib/stripe.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/corporate/lib/stripe.py b/corporate/lib/stripe.py index 0a42446106..da4800ef18 100644 --- a/corporate/lib/stripe.py +++ b/corporate/lib/stripe.py @@ -2792,7 +2792,11 @@ class BillingSession(ABC): "quantity": ledger_entry.licenses, } description = f"{plan.name} - renewal" - elif licenses_base is not None and ledger_entry.licenses != licenses_base: + elif ( + plan.fixed_price is None + and licenses_base is not None + and ledger_entry.licenses != licenses_base + ): assert plan.price_per_license is not None last_ledger_entry_renewal = ( LicenseLedger.objects.filter(