From a3cd3d68654df4285ebf76b64f44c4cecd8f225c Mon Sep 17 00:00:00 2001 From: Mateusz Mandera Date: Mon, 8 Mar 2021 11:22:06 +0100 Subject: [PATCH] bots: Pass realm to get_system_bot calls in stripe. --- corporate/lib/stripe.py | 2 +- corporate/tests/test_stripe.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/corporate/lib/stripe.py b/corporate/lib/stripe.py index 087078d0f5..5df0c9fbf7 100644 --- a/corporate/lib/stripe.py +++ b/corporate/lib/stripe.py @@ -887,7 +887,7 @@ def approve_sponsorship(realm: Realm, *, acting_user: Optional[UserProfile]) -> event_type=RealmAuditLog.REALM_SPONSORSHIP_APPROVED, event_time=timezone_now(), ) - notification_bot = get_system_bot(settings.NOTIFICATION_BOT) + notification_bot = get_system_bot(settings.NOTIFICATION_BOT, realm.id) for user in realm.get_human_billing_admin_and_realm_owner_users(): with override_language(user.default_language): # Using variable to make life easier for translators if these details change. diff --git a/corporate/tests/test_stripe.py b/corporate/tests/test_stripe.py index 139cb2b0f3..153819d566 100644 --- a/corporate/tests/test_stripe.py +++ b/corporate/tests/test_stripe.py @@ -1756,7 +1756,7 @@ class StripeTest(StripeTestCase): self.assertEqual(realm.plan_type, Realm.STANDARD_FREE) expected_message = "Your organization's request for sponsored hosting has been approved! :tada:.\nYou have been upgraded to Zulip Cloud Standard, free of charge." - sender = get_system_bot(settings.NOTIFICATION_BOT) + sender = get_system_bot(settings.NOTIFICATION_BOT, user.realm_id) recipient_id = self.example_user("desdemona").recipient_id message = Message.objects.filter(sender=sender.id).first() assert message is not None