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: Keep remote realm and server type_of_plan_tier_change in sync.

Aman Agrawalbddc271e8451
diff --git a/corporate/lib/stripe.py b/corporate/lib/stripe.py
index 378c78cb74b..46a1c310ebe 100644
--- a/corporate/lib/stripe.py
+++ b/corporate/lib/stripe.py
@@ -4146,6 +4146,16 @@ class RemoteRealmBillingSession(BillingSession):
CustomerPlan.TIER_SELF_HOSTED_BUSINESS,
):
return PlanTierChangeType.UPGRADE
+ elif (
+ current_plan_tier == CustomerPlan.TIER_SELF_HOSTED_BASIC
+ and new_plan_tier == CustomerPlan.TIER_SELF_HOSTED_LEGACY
+ ):
+ return PlanTierChangeType.DOWNGRADE
+ elif (
+ current_plan_tier == CustomerPlan.TIER_SELF_HOSTED_BUSINESS
+ and new_plan_tier == CustomerPlan.TIER_SELF_HOSTED_LEGACY
+ ):
+ return PlanTierChangeType.DOWNGRADE
else:
assert current_plan_tier == CustomerPlan.TIER_SELF_HOSTED_BUSINESS
assert new_plan_tier == CustomerPlan.TIER_SELF_HOSTED_BASIC