Skip to content

armgit / zulip

Public Imported from GitHub
0

Zulip server and web application. Open-source team chat that helps teams stay productive and focused.

stripe: Allow customers without a plan to upgrade.

Aman Agrawal89a28f6577a4
diff --git a/corporate/lib/stripe.py b/corporate/lib/stripe.py
index 509e5341f1d..8e5eb9b6dc3 100644
--- a/corporate/lib/stripe.py
+++ b/corporate/lib/stripe.py
@@ -1122,7 +1122,10 @@ class BillingSession(ABC):
return
plan = get_current_plan_by_customer(customer)
- assert plan is not None
+ # Customers without a plan can always upgrade.
+ if plan is None:
+ return
+
type_of_plan_change = self.get_type_of_plan_tier_change(plan.tier, new_plan_tier)
if type_of_plan_change != PlanTierChangeType.UPGRADE:
raise InvalidPlanUpgradeError(