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: Add transaction.atomic to bulk_add_subs_to_db_with_logging.

Tim Abbottbf66e9c4abb2
diff --git a/zerver/lib/actions.py b/zerver/lib/actions.py
index 2cb17f965e3..ec7ffde89d5 100644
--- a/zerver/lib/actions.py
+++ b/zerver/lib/actions.py
@@ -2929,6 +2929,11 @@ def bulk_add_subscriptions(
already_subscribed,
)
+# This function contains all the database changes as part of
+# subscribing users to streams; we use a transaction to ensure that
+# the RealmAuditLog entries are created atomically with the
+# Subscription object creation (and updates).
def bulk_add_subs_to_db_with_logging(
realm: Realm,
acting_user: Optional[UserProfile],