From e44f3d448d1fa7c5db04a14e4b1ecc678a607673 Mon Sep 17 00:00:00 2001 From: Aman Agrawal Date: Sat, 9 Dec 2023 08:00:34 +0000 Subject: [PATCH] stripe: Use `next_plan` instead of `new_plan` for legacy upgrades. --- corporate/lib/stripe.py | 6 +++--- corporate/views/billing_page.py | 2 +- templates/corporate/billing.html | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/corporate/lib/stripe.py b/corporate/lib/stripe.py index 3bd863140b..33b494d5cf 100644 --- a/corporate/lib/stripe.py +++ b/corporate/lib/stripe.py @@ -829,7 +829,7 @@ class BillingSession(ABC): assert plan.end_date is not None return plan.end_date.strftime("%B %d, %Y") - def get_legacy_remote_server_new_plan_name( + def get_legacy_remote_server_next_plan_name( self, customer: Customer ) -> Optional[str]: # nocoverage legacy_plan = self.get_remote_server_legacy_plan( @@ -1671,7 +1671,7 @@ class BillingSession(ABC): remote_server_legacy_plan_end_date = self.get_formatted_remote_server_legacy_plan_end_date( customer, status=CustomerPlan.SWITCH_PLAN_TIER_AT_PLAN_END ) - legacy_remote_server_new_plan_name = self.get_legacy_remote_server_new_plan_name(customer) + legacy_remote_server_next_plan_name = self.get_legacy_remote_server_next_plan_name(customer) is_self_hosted_billing = not isinstance(self, RealmBillingSession) context = { "plan_name": plan.name, @@ -1702,7 +1702,7 @@ class BillingSession(ABC): "is_self_hosted_billing": is_self_hosted_billing, "is_server_on_legacy_plan": remote_server_legacy_plan_end_date is not None, "remote_server_legacy_plan_end_date": remote_server_legacy_plan_end_date, - "legacy_remote_server_new_plan_name": legacy_remote_server_new_plan_name, + "legacy_remote_server_next_plan_name": legacy_remote_server_next_plan_name, "using_min_licenses_for_plan": using_min_licenses_for_plan, } return context diff --git a/corporate/views/billing_page.py b/corporate/views/billing_page.py index 37b80ef662..272645801c 100644 --- a/corporate/views/billing_page.py +++ b/corporate/views/billing_page.py @@ -172,7 +172,7 @@ def remote_server_billing_page( customer is None or get_current_plan_by_customer(customer) is None or ( - billing_session.get_legacy_remote_server_new_plan_name(customer) is None + billing_session.get_legacy_remote_server_next_plan_name(customer) is None and billing_session.remote_server.plan_type == RemoteZulipServer.PLAN_TYPE_SELF_HOSTED ) ): diff --git a/templates/corporate/billing.html b/templates/corporate/billing.html index a9b4b272f4..0de35a9bc5 100644 --- a/templates/corporate/billing.html +++ b/templates/corporate/billing.html @@ -180,7 +180,7 @@ {% else %} {% if charge_automatically %} {% if is_server_on_legacy_plan %} - Your plan will automatically upgrade to {{ legacy_remote_server_new_plan_name }} on {{ remote_server_legacy_plan_end_date }}. + Your plan will automatically upgrade to {{ legacy_remote_server_next_plan_name }} on {{ remote_server_legacy_plan_end_date }}. {% else %} Your plan will automatically renew on {{ renewal_date }}. {% endif %}