users: Add `savepoint=False` to avoid creating savepoints.

'do_deactivate_user' is used inside an outer db transaction
created in 'sync_user_from_ldap'.

`transaction.atomic()` block in 'do_deactivate_user' resulted
in savepoint creation.

This commit adds `savepoint=False` to avoid that.
This commit is contained in:
Prakhar Pratyush 2024-11-04 14:00:30 +05:30 committed by Tim Abbott
parent 27eeb08459
commit 86a909e703
1 changed files with 1 additions and 1 deletions

View File

@ -486,7 +486,7 @@ def do_deactivate_user(
for profile in bot_profiles: for profile in bot_profiles:
do_deactivate_user(profile, _cascade=False, acting_user=acting_user) do_deactivate_user(profile, _cascade=False, acting_user=acting_user)
with transaction.atomic(): with transaction.atomic(savepoint=False):
if user_profile.realm.is_zephyr_mirror_realm: # nocoverage if user_profile.realm.is_zephyr_mirror_realm: # nocoverage
# For zephyr mirror users, we need to make them a mirror dummy # For zephyr mirror users, we need to make them a mirror dummy
# again; otherwise, other users won't get the correct behavior # again; otherwise, other users won't get the correct behavior