Skip to content

armgit / zulip

Public Imported from GitHub
0

Zulip server and web application. Open-source team chat that helps teams stay productive and focused.

bots: Pass realm to get_system_bot calls in stripe.

Mateusz Manderaa3cd3d68654d
diff --git a/corporate/lib/stripe.py b/corporate/lib/stripe.py
index 087078d0f5f..5df0c9fbf73 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 139cb2b0f34..153819d5663 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