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: Pass realm_playgrounds as argument to notify_realm_playgrounds.

Sahil Batra9fd9c5f1d284
diff --git a/zerver/lib/actions.py b/zerver/lib/actions.py
index 2b6087deac9..635b4e588d0 100644
--- a/zerver/lib/actions.py
+++ b/zerver/lib/actions.py
@@ -8097,8 +8097,10 @@ def do_remove_realm_domain(
transaction.on_commit(lambda: send_event(realm, event, active_user_ids(realm.id)))
-def notify_realm_playgrounds(realm: Realm) -> None:
- event = dict(type="realm_playgrounds", realm_playgrounds=get_realm_playgrounds(realm))
+def notify_realm_playgrounds(
+ realm: Realm, realm_playgrounds: List[Dict[str, Union[int, str]]]
+) -> None:
+ event = dict(type="realm_playgrounds", realm_playgrounds=realm_playgrounds)
send_event(realm, event, active_user_ids(realm.id))
@@ -8109,13 +8111,16 @@ def do_add_realm_playground(realm: Realm, **kwargs: Any) -> int:
# before calling this function.
realm_playground.full_clean()
realm_playground.save()
- notify_realm_playgrounds(realm)
+ realm_playgrounds = get_realm_playgrounds(realm)
+ notify_realm_playgrounds(realm, realm_playgrounds)
+
return realm_playground.id
def do_remove_realm_playground(realm: Realm, realm_playground: RealmPlayground) -> None:
realm_playground.delete()
- notify_realm_playgrounds(realm)
+ realm_playgrounds = get_realm_playgrounds(realm)
+ notify_realm_playgrounds(realm, realm_playgrounds)
def get_occupied_streams(realm: Realm) -> QuerySet: