billing: Set the legacy plan type when migrating.

This commit is contained in:
Tim Abbott 2023-12-13 16:16:03 -08:00
parent 6308e07e53
commit d040664952
1 changed files with 6 additions and 0 deletions

View File

@ -2653,6 +2653,8 @@ class BillingSession(ABC):
extra_data=legacy_plan_params, extra_data=legacy_plan_params,
) )
self.do_change_plan_type(tier=CustomerPlan.TIER_SELF_HOSTED_LEGACY, is_sponsored=False)
def get_last_ledger_for_automanaged_plan_if_exists( def get_last_ledger_for_automanaged_plan_if_exists(
self, self,
) -> Optional[LicenseLedger]: # nocoverage ) -> Optional[LicenseLedger]: # nocoverage
@ -3177,6 +3179,8 @@ class RemoteRealmBillingSession(BillingSession):
plan_type = RemoteRealm.PLAN_TYPE_COMMUNITY plan_type = RemoteRealm.PLAN_TYPE_COMMUNITY
elif tier == CustomerPlan.TIER_SELF_HOSTED_BUSINESS: elif tier == CustomerPlan.TIER_SELF_HOSTED_BUSINESS:
plan_type = RemoteRealm.PLAN_TYPE_BUSINESS plan_type = RemoteRealm.PLAN_TYPE_BUSINESS
elif tier == CustomerPlan.TIER_SELF_HOSTED_LEGACY:
plan_type = RemoteRealm.PLAN_TYPE_SELF_MANAGED_LEGACY
else: else:
raise AssertionError("Unexpected tier") raise AssertionError("Unexpected tier")
@ -3567,6 +3571,8 @@ class RemoteServerBillingSession(BillingSession):
plan_type = RemoteZulipServer.PLAN_TYPE_COMMUNITY plan_type = RemoteZulipServer.PLAN_TYPE_COMMUNITY
elif tier == CustomerPlan.TIER_SELF_HOSTED_BUSINESS: elif tier == CustomerPlan.TIER_SELF_HOSTED_BUSINESS:
plan_type = RemoteZulipServer.PLAN_TYPE_BUSINESS plan_type = RemoteZulipServer.PLAN_TYPE_BUSINESS
elif tier == CustomerPlan.TIER_SELF_HOSTED_LEGACY:
plan_type = RemoteZulipServer.PLAN_TYPE_SELF_MANAGED_LEGACY
else: else:
raise AssertionError("Unexpected tier") raise AssertionError("Unexpected tier")