actions: Use transaction.atomic in do_change_tos_version.

This commit is contained in:
Sahil Batra 2022-01-03 23:24:14 +05:30 committed by Tim Abbott
parent 06d715a41d
commit 7c44151135
1 changed files with 1 additions and 0 deletions

View File

@ -4568,6 +4568,7 @@ def do_change_bot_owner(
send_event(user_profile.realm, event, active_user_ids(user_profile.realm_id)) 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: def do_change_tos_version(user_profile: UserProfile, tos_version: str) -> None:
user_profile.tos_version = tos_version user_profile.tos_version = tos_version
user_profile.save(update_fields=["tos_version"]) user_profile.save(update_fields=["tos_version"])