From 86a909e7036c7775a8587301deb43f073d2f4557 Mon Sep 17 00:00:00 2001 From: Prakhar Pratyush Date: Mon, 4 Nov 2024 14:00:30 +0530 Subject: [PATCH] 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. --- zerver/actions/users.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/zerver/actions/users.py b/zerver/actions/users.py index 6079a36ffe..a215030f03 100644 --- a/zerver/actions/users.py +++ b/zerver/actions/users.py @@ -486,7 +486,7 @@ def do_deactivate_user( for profile in bot_profiles: 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 # For zephyr mirror users, we need to make them a mirror dummy # again; otherwise, other users won't get the correct behavior