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.
This commit is contained in:
Prakhar Pratyush 2024-11-01 21:58:39 +05:30 committed by Tim Abbott
parent f351f94827
commit a34577f82e
1 changed files with 2 additions and 2 deletions

View File

@ -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)) 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( def add_subgroups_to_user_group(
user_group: NamedUserGroup, user_group: NamedUserGroup,
subgroups: list[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) do_send_subgroups_update_event("add_subgroups", user_group, subgroup_ids)
@transaction.atomic @transaction.atomic(savepoint=False)
def remove_subgroups_from_user_group( def remove_subgroups_from_user_group(
user_group: NamedUserGroup, user_group: NamedUserGroup,
subgroups: list[NamedUserGroup], subgroups: list[NamedUserGroup],