Zulip server and web application. Open-source team chat that helps teams stay productive and focused.
stripe: Rename get_legacy_remote_server_next_plan_name.
Lauryn Menardb6f8c2077285
diff --git a/corporate/lib/stripe.py b/corporate/lib/stripe.pyindex 58b56ee5797..b312db07a83 100644--- a/corporate/lib/stripe.py+++ b/corporate/lib/stripe.py@@ -1078,7 +1078,7 @@ class BillingSession(ABC):status=CustomerPlan.NEVER_STARTED,)- def get_legacy_remote_server_next_plan_name(self, customer: Customer) -> str | None:+ def get_complimentary_access_next_plan_name(self, customer: Customer) -> str | None:next_plan = self.get_legacy_remote_server_next_plan(customer)if next_plan is None:return None@@ -2550,7 +2550,7 @@ class BillingSession(ABC):complimentary_access_plan_end_date = self.get_formatted_complimentary_access_plan_end_date(customer, status=CustomerPlan.SWITCH_PLAN_TIER_AT_PLAN_END)- legacy_remote_server_next_plan_name = self.get_legacy_remote_server_next_plan_name(customer)+ complimentary_access_next_plan_name = self.get_complimentary_access_next_plan_name(customer)context = {"plan_name": plan.name,"has_active_plan": True,@@ -2581,7 +2581,7 @@ class BillingSession(ABC):"is_self_hosted_billing": is_self_hosted_billing,"complimentary_access_plan": complimentary_access_plan_end_date is not None,"complimentary_access_plan_end_date": complimentary_access_plan_end_date,- "complimentary_access_next_plan_name": legacy_remote_server_next_plan_name,+ "complimentary_access_next_plan_name": complimentary_access_next_plan_name,"using_min_licenses_for_plan": using_min_licenses_for_plan,"min_licenses_for_plan": min_licenses_for_plan,"pre_discount_renewal_cents": cents_to_dollar_string(pre_discount_renewal_cents),diff --git a/corporate/views/billing_page.py b/corporate/views/billing_page.pyindex 6249c90d55b..4097d63ef38 100644--- a/corporate/views/billing_page.py+++ b/corporate/views/billing_page.py@@ -111,10 +111,11 @@ def remote_realm_billing_page(customer = billing_session.get_customer()if customer is not None and customer.sponsorship_pending: # nocoverage- # Don't redirect to sponsorship page if the remote realm is on a paid plan or scheduled for an upgrade.+ # Don't redirect to sponsorship page if the remote realm is on a paid plan or+ # has scheduled an upgrade for their current complimentary access plan.if (not billing_session.on_paid_plan()- and billing_session.get_legacy_remote_server_next_plan_name(customer) is None+ and billing_session.get_complimentary_access_next_plan_name(customer) is None):return HttpResponseRedirect(reverse("remote_realm_sponsorship_page", args=(realm_uuid,))@@ -126,7 +127,7 @@ def remote_realm_billing_page(customer is Noneor get_current_plan_by_customer(customer) is Noneor (- billing_session.get_legacy_remote_server_next_plan_name(customer) is None+ billing_session.get_complimentary_access_next_plan_name(customer) is Noneand billing_session.remote_realm.plan_typein [RemoteRealm.PLAN_TYPE_SELF_MANAGED,@@ -178,10 +179,11 @@ def remote_server_billing_page(customer = billing_session.get_customer()if customer is not None and customer.sponsorship_pending:- # Don't redirect to sponsorship page if the remote realm is on a paid plan or scheduled for an upgrade.+ # Don't redirect to sponsorship page if the remote realm is on a paid plan or+ # has scheduled an upgrade for their current complimentary access plan.if (not billing_session.on_paid_plan()- and billing_session.get_legacy_remote_server_next_plan_name(customer) is None+ and billing_session.get_complimentary_access_next_plan_name(customer) is None):return HttpResponseRedirect(reverse(@@ -196,7 +198,7 @@ def remote_server_billing_page(customer is Noneor get_current_plan_by_customer(customer) is Noneor (- billing_session.get_legacy_remote_server_next_plan_name(customer) is None+ billing_session.get_complimentary_access_next_plan_name(customer) is Noneand billing_session.remote_server.plan_typein [RemoteZulipServer.PLAN_TYPE_SELF_MANAGED,diff --git a/corporate/views/remote_billing_page.py b/corporate/views/remote_billing_page.pyindex 9021beee46d..64ef5770c47 100644--- a/corporate/views/remote_billing_page.py+++ b/corporate/views/remote_billing_page.py@@ -336,12 +336,13 @@ def remote_realm_billing_finalize_login(RemoteRealm.PLAN_TYPE_SELF_MANAGED,RemoteRealm.PLAN_TYPE_SELF_MANAGED_LEGACY,]:- # If they have a scheduled upgrade, redirect to billing page.+ # If they have a scheduled upgrade while on a complimentary access plan,+ # redirect to billing page.billing_session = RemoteRealmBillingSession(remote_realm)customer = billing_session.get_customer()if (customer is not None- and billing_session.get_legacy_remote_server_next_plan_name(customer) is not None+ and billing_session.get_complimentary_access_next_plan_name(customer) is not None):return HttpResponseRedirect(reverse("remote_realm_billing_page", args=(remote_realm_uuid,))@@ -784,12 +785,13 @@ def remote_billing_legacy_server_from_login_confirmation_link(RemoteZulipServer.PLAN_TYPE_SELF_MANAGED,RemoteZulipServer.PLAN_TYPE_SELF_MANAGED_LEGACY,]:- # If they have a scheduled upgrade, redirect to billing page.+ # If they have a scheduled upgrade while on a complimentary access plan,+ # redirect to billing page.billing_session = RemoteServerBillingSession(remote_server)customer = billing_session.get_customer()if (customer is not None- and billing_session.get_legacy_remote_server_next_plan_name(customer) is not None+ and billing_session.get_complimentary_access_next_plan_name(customer) is not None):return HttpResponseRedirect(reverse("remote_server_billing_page", args=(remote_server_uuid,))