mirror of
https://github.com/zulip/zulip.git
synced 2025-11-09 16:37:23 +00:00
actions: Use transaction.atomic for do_change_default_all_public_streams.
This commit is contained in:
@@ -4895,6 +4895,7 @@ def do_change_default_events_register_stream(
|
||||
)
|
||||
|
||||
|
||||
@transaction.atomic(durable=True)
|
||||
def do_change_default_all_public_streams(
|
||||
user_profile: UserProfile, value: bool, *, acting_user: Optional[UserProfile]
|
||||
) -> None:
|
||||
@@ -4918,18 +4919,21 @@ def do_change_default_all_public_streams(
|
||||
)
|
||||
|
||||
if user_profile.is_bot:
|
||||
send_event(
|
||||
user_profile.realm,
|
||||
dict(
|
||||
event = dict(
|
||||
type="realm_bot",
|
||||
op="update",
|
||||
bot=dict(
|
||||
user_id=user_profile.id,
|
||||
default_all_public_streams=user_profile.default_all_public_streams,
|
||||
),
|
||||
),
|
||||
)
|
||||
transaction.on_commit(
|
||||
lambda: send_event(
|
||||
user_profile.realm,
|
||||
event,
|
||||
bot_owner_user_ids(user_profile),
|
||||
)
|
||||
)
|
||||
|
||||
|
||||
@transaction.atomic
|
||||
|
||||
Reference in New Issue
Block a user