actions: Use transaction.atomic for do_add_realm_playground.

This commit is contained in:
Sahil Batra
2022-03-11 20:27:11 +05:30
committed by Tim Abbott
parent b86b9bdc02
commit 578b752766

View File

@@ -8101,9 +8101,10 @@ 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))
transaction.on_commit(lambda: send_event(realm, event, active_user_ids(realm.id)))
@transaction.atomic(durable=True)
def do_add_realm_playground(
realm: Realm, *, acting_user: Optional[UserProfile], **kwargs: Any
) -> int: