From 33f7da23a041c0b994a62b8a330b5ecaabddf33c Mon Sep 17 00:00:00 2001 From: Alex Vandiver Date: Fri, 16 May 2025 03:51:48 +0000 Subject: [PATCH] stripe: Do not place Realm objects into context. --- corporate/lib/stripe.py | 3 ++- templates/zerver/emails/realm_auto_downgraded.html | 2 +- templates/zerver/emails/realm_auto_downgraded.subject.txt | 2 +- templates/zerver/emails/realm_auto_downgraded.txt | 2 +- 4 files changed, 5 insertions(+), 4 deletions(-) diff --git a/corporate/lib/stripe.py b/corporate/lib/stripe.py index 6bf25cdace..0216709e1b 100644 --- a/corporate/lib/stripe.py +++ b/corporate/lib/stripe.py @@ -5671,7 +5671,8 @@ def downgrade_small_realms_behind_on_payments_as_needed() -> None: billing_session.void_all_open_invoices() context: dict[str, str | Realm] = { "upgrade_url": f"{realm.url}{reverse('upgrade_page')}", - "realm": realm, + "realm_url": realm.url, + "string_id": realm.string_id, } send_email_to_users_with_billing_access_and_realm_owners( "zerver/emails/realm_auto_downgraded", diff --git a/templates/zerver/emails/realm_auto_downgraded.html b/templates/zerver/emails/realm_auto_downgraded.html index c37e036ab7..e58ec7c790 100644 --- a/templates/zerver/emails/realm_auto_downgraded.html +++ b/templates/zerver/emails/realm_auto_downgraded.html @@ -5,7 +5,7 @@ {% endblock %} {% block content %} - {% trans organization_name_with_link=macros.link_tag(realm.url, realm.string_id) %} + {% trans organization_name_with_link=macros.link_tag(realm_url, string_id) %} Your organization, {{ organization_name_with_link }}, has been downgraded to the Zulip Cloud Free plan because of unpaid invoices. The unpaid invoices have been voided. {% endtrans %} diff --git a/templates/zerver/emails/realm_auto_downgraded.subject.txt b/templates/zerver/emails/realm_auto_downgraded.subject.txt index 1aaae918c2..e9f1aa8792 100644 --- a/templates/zerver/emails/realm_auto_downgraded.subject.txt +++ b/templates/zerver/emails/realm_auto_downgraded.subject.txt @@ -1 +1 @@ -{{ realm.string_id }}: Your organization has been downgraded to Zulip Cloud Free +{{ string_id }}: Your organization has been downgraded to Zulip Cloud Free diff --git a/templates/zerver/emails/realm_auto_downgraded.txt b/templates/zerver/emails/realm_auto_downgraded.txt index 09a25eeece..808bf96131 100644 --- a/templates/zerver/emails/realm_auto_downgraded.txt +++ b/templates/zerver/emails/realm_auto_downgraded.txt @@ -1,4 +1,4 @@ -Your organization, {{ realm.url }}, has been downgraded to the Zulip Cloud +Your organization, {{ realm_url }}, has been downgraded to the Zulip Cloud Free plan because of unpaid invoices. The unpaid invoices have been voided. To continue on the Zulip Cloud Standard plan, please upgrade again by going