mirror of
https://github.com/zulip/zulip.git
synced 2025-11-06 15:03:34 +00:00
bots: Pass realm to get_system_bot calls in stripe.
This commit is contained in:
committed by
Tim Abbott
parent
57f14b247e
commit
a3cd3d6865
@@ -887,7 +887,7 @@ def approve_sponsorship(realm: Realm, *, acting_user: Optional[UserProfile]) ->
|
|||||||
event_type=RealmAuditLog.REALM_SPONSORSHIP_APPROVED,
|
event_type=RealmAuditLog.REALM_SPONSORSHIP_APPROVED,
|
||||||
event_time=timezone_now(),
|
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():
|
for user in realm.get_human_billing_admin_and_realm_owner_users():
|
||||||
with override_language(user.default_language):
|
with override_language(user.default_language):
|
||||||
# Using variable to make life easier for translators if these details change.
|
# Using variable to make life easier for translators if these details change.
|
||||||
|
|||||||
@@ -1756,7 +1756,7 @@ class StripeTest(StripeTestCase):
|
|||||||
self.assertEqual(realm.plan_type, Realm.STANDARD_FREE)
|
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."
|
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
|
recipient_id = self.example_user("desdemona").recipient_id
|
||||||
message = Message.objects.filter(sender=sender.id).first()
|
message = Message.objects.filter(sender=sender.id).first()
|
||||||
assert message is not None
|
assert message is not None
|
||||||
|
|||||||
Reference in New Issue
Block a user