From 27eeb0845908abd869aac7039f056d978c27e1fe Mon Sep 17 00:00:00 2001 From: Prakhar Pratyush Date: Mon, 4 Nov 2024 13:31:26 +0530 Subject: [PATCH] streams: Add `savepoint=False` to avoid creating savepoints. 'bulk_remove_subscriptions' is used inside an outer db transaction created in 'do_change_bot_owner'. `transaction.atomic()` block in 'bulk_remove_subscriptions' resulted in savepoint creation. This commit adds `savepoint=False` to avoid that. --- zerver/actions/streams.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/zerver/actions/streams.py b/zerver/actions/streams.py index 181a93c795..2271759614 100644 --- a/zerver/actions/streams.py +++ b/zerver/actions/streams.py @@ -979,7 +979,7 @@ def bulk_remove_subscriptions( streams_to_unsubscribe = [sub_info.stream for sub_info in subs_to_deactivate] # We do all the database changes in a transaction to ensure # RealmAuditLog entries are atomically created when making changes. - with transaction.atomic(): + with transaction.atomic(savepoint=False): Subscription.objects.filter( id__in=sub_ids_to_deactivate, ).update(active=False)