mirror of https://github.com/zulip/zulip.git
stripe: Don't change plan tier before the plan becomes live.
For new plans that have not started, the tier change should only happen when they become live.
This commit is contained in:
parent
ec7fd94782
commit
860e4f6060
|
@ -1246,7 +1246,9 @@ class BillingSession(ABC):
|
|||
)
|
||||
stripe.Invoice.finalize_invoice(stripe_invoice)
|
||||
|
||||
self.do_change_plan_type(tier=plan_tier)
|
||||
if plan.status < CustomerPlan.LIVE_STATUS_THRESHOLD:
|
||||
# Tier and usage limit change will happen when plan becomes live.
|
||||
self.do_change_plan_type(tier=plan_tier)
|
||||
|
||||
def do_upgrade(self, upgrade_request: UpgradeRequest) -> Dict[str, Any]:
|
||||
customer = self.get_customer()
|
||||
|
@ -1457,6 +1459,7 @@ class BillingSession(ABC):
|
|||
)
|
||||
new_plan.status = CustomerPlan.ACTIVE
|
||||
new_plan.save(update_fields=["status"])
|
||||
self.do_change_plan_type(tier=new_plan.tier)
|
||||
return None, LicenseLedger.objects.create(
|
||||
plan=new_plan,
|
||||
is_renewal=True,
|
||||
|
|
Loading…
Reference in New Issue