From a34577f82e7a3f335944c9a641778026d10566b1 Mon Sep 17 00:00:00 2001 From: Prakhar Pratyush Date: Fri, 1 Nov 2024 21:58:39 +0530 Subject: [PATCH] user_groups: Add savepoint=False to avoid creating savepoints. add_subgroups_to_user_group and remove_subgroups_from_user_group are already inside outer db transactions. This commit explicitly adds 'savepoint=False' to avoid creating savepoints. --- zerver/actions/user_groups.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/zerver/actions/user_groups.py b/zerver/actions/user_groups.py index e6fc48dc66..42d66ee0c6 100644 --- a/zerver/actions/user_groups.py +++ b/zerver/actions/user_groups.py @@ -366,7 +366,7 @@ def do_send_subgroups_update_event( send_event_on_commit(user_group.realm, event, active_user_ids(user_group.realm_id)) -@transaction.atomic +@transaction.atomic(savepoint=False) def add_subgroups_to_user_group( user_group: NamedUserGroup, subgroups: list[NamedUserGroup], @@ -406,7 +406,7 @@ def add_subgroups_to_user_group( do_send_subgroups_update_event("add_subgroups", user_group, subgroup_ids) -@transaction.atomic +@transaction.atomic(savepoint=False) def remove_subgroups_from_user_group( user_group: NamedUserGroup, subgroups: list[NamedUserGroup],