Zulip server and web application. Open-source team chat that helps teams stay productive and focused.
realm: Deactivate realms inside a transaction.
Tim Abbott6f93ab72c03a
diff --git a/zerver/actions/realm_settings.py b/zerver/actions/realm_settings.pyindex 20bfd99a57e..205f883a5a2 100644--- a/zerver/actions/realm_settings.py+++ b/zerver/actions/realm_settings.py@@ -336,6 +336,7 @@ def do_set_realm_user_default_setting(send_event(realm, event, active_user_ids(realm.id))def do_deactivate_realm(realm: Realm, *, acting_user: Optional[UserProfile]) -> None:"""Deactivate this realm. Do NOT deactivate the users -- we need to be able to@@ -379,7 +380,7 @@ def do_deactivate_realm(realm: Realm, *, acting_user: Optional[UserProfile]) -># deactivated). So the purpose of sending this is to flush all# active longpoll connections for the realm.event = dict(type="realm", op="deactivated", realm_id=realm.id)- send_event(realm, event, active_user_ids(realm.id))+ send_event_on_commit(realm, event, active_user_ids(realm.id))def do_reactivate_realm(realm: Realm) -> None: