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.

actions: Use transaction.atomic for do_change_realm_plan_type.

Sahil Batraa2df7470d506
diff --git a/zerver/lib/actions.py b/zerver/lib/actions.py
index 8e965d02534..01f54dc04ed 100644
--- a/zerver/lib/actions.py
+++ b/zerver/lib/actions.py
@@ -4787,6 +4787,7 @@ def do_change_realm_org_type(
)
[email protected](savepoint=False)
def do_change_realm_plan_type(
realm: Realm, plan_type: int, *, acting_user: Optional[UserProfile]
) -> None:
@@ -4835,7 +4836,7 @@ def do_change_realm_plan_type(
"value": plan_type,
"extra_data": {"upload_quota": realm.upload_quota_bytes()},
}
- send_event(realm, event, active_user_ids(realm.id))
+ transaction.on_commit(lambda: send_event(realm, event, active_user_ids(realm.id)))
@transaction.atomic(durable=True)