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(
|
def do_change_default_all_public_streams(
|
||||||
user_profile: UserProfile, value: bool, *, acting_user: Optional[UserProfile]
|
user_profile: UserProfile, value: bool, *, acting_user: Optional[UserProfile]
|
||||||
) -> None:
|
) -> None:
|
||||||
@@ -4918,18 +4919,21 @@ def do_change_default_all_public_streams(
|
|||||||
)
|
)
|
||||||
|
|
||||||
if user_profile.is_bot:
|
if user_profile.is_bot:
|
||||||
send_event(
|
event = dict(
|
||||||
user_profile.realm,
|
|
||||||
dict(
|
|
||||||
type="realm_bot",
|
type="realm_bot",
|
||||||
op="update",
|
op="update",
|
||||||
bot=dict(
|
bot=dict(
|
||||||
user_id=user_profile.id,
|
user_id=user_profile.id,
|
||||||
default_all_public_streams=user_profile.default_all_public_streams,
|
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),
|
bot_owner_user_ids(user_profile),
|
||||||
)
|
)
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
@transaction.atomic
|
@transaction.atomic
|
||||||
|
|||||||
Reference in New Issue
Block a user