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_add_realm_domain.

Sahil Batra9b9931df7f8f
diff --git a/zerver/lib/actions.py b/zerver/lib/actions.py
index 06b1dc4857b..c0b59794970 100644
--- a/zerver/lib/actions.py
+++ b/zerver/lib/actions.py
@@ -8087,6 +8087,7 @@ def do_update_linkifier(realm: Realm, id: int, pattern: str, url_format_string:
notify_linkifiers(realm)
[email protected](durable=True)
def do_add_realm_domain(
realm: Realm, domain: str, allow_subdomains: bool, *, acting_user: Optional[UserProfile]
) -> (RealmDomain):
@@ -8114,7 +8115,7 @@ def do_add_realm_domain(
domain=realm_domain.domain, allow_subdomains=realm_domain.allow_subdomains
),
)
- send_event(realm, event, active_user_ids(realm.id))
+ transaction.on_commit(lambda: send_event(realm, event, active_user_ids(realm.id)))
return realm_domain