From 7c4415113514f3fdebc57cf0f945a53aad7a8e52 Mon Sep 17 00:00:00 2001 From: Sahil Batra Date: Mon, 3 Jan 2022 23:24:14 +0530 Subject: [PATCH] actions: Use transaction.atomic in do_change_tos_version. --- zerver/lib/actions.py | 1 + 1 file changed, 1 insertion(+) diff --git a/zerver/lib/actions.py b/zerver/lib/actions.py index a4a5158af8..6f7c0c149f 100644 --- a/zerver/lib/actions.py +++ b/zerver/lib/actions.py @@ -4568,6 +4568,7 @@ def do_change_bot_owner( send_event(user_profile.realm, event, active_user_ids(user_profile.realm_id)) +@transaction.atomic(durable=True) def do_change_tos_version(user_profile: UserProfile, tos_version: str) -> None: user_profile.tos_version = tos_version user_profile.save(update_fields=["tos_version"])