diff --git a/corporate/views/portico.py b/corporate/views/portico.py index 0cbf13e5b9..4af8baac32 100644 --- a/corporate/views/portico.py +++ b/corporate/views/portico.py @@ -74,6 +74,8 @@ class PlansPageContext: is_new_customer: bool = False on_free_tier: bool = False customer_plan: Optional[CustomerPlan] = None + is_legacy_server_with_scheduled_upgrade: bool = False + legacy_server_new_plan: Optional[CustomerPlan] = None billing_base_url: str = "" @@ -183,6 +185,16 @@ def remote_server_plans_page( CustomerPlan.TIER_SELF_HOSTED_BASE, ) context.on_free_trial = is_customer_on_free_trial(context.customer_plan) + context.is_legacy_server_with_scheduled_upgrade = ( + context.customer_plan.status == CustomerPlan.SWITCH_PLAN_TIER_AT_PLAN_END + ) + if context.is_legacy_server_with_scheduled_upgrade: + assert context.customer_plan.end_date is not None + context.legacy_server_new_plan = CustomerPlan.objects.get( + customer=customer, + billing_cycle_anchor=context.customer_plan.end_date, + status=CustomerPlan.NEVER_STARTED, + ) context.is_new_customer = ( not context.on_free_tier and context.customer_plan is None and not context.is_sponsored diff --git a/templates/corporate/pricing_model.html b/templates/corporate/pricing_model.html index 86de684bfc..1078f7d490 100644 --- a/templates/corporate/pricing_model.html +++ b/templates/corporate/pricing_model.html @@ -188,7 +188,11 @@