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.
This commit is contained in:
Prakhar Pratyush 2024-11-04 13:31:26 +05:30 committed by Tim Abbott
parent 8c8cc80183
commit 27eeb08459
1 changed files with 1 additions and 1 deletions

View File

@ -979,7 +979,7 @@ def bulk_remove_subscriptions(
streams_to_unsubscribe = [sub_info.stream for sub_info in subs_to_deactivate] streams_to_unsubscribe = [sub_info.stream for sub_info in subs_to_deactivate]
# We do all the database changes in a transaction to ensure # We do all the database changes in a transaction to ensure
# RealmAuditLog entries are atomically created when making changes. # RealmAuditLog entries are atomically created when making changes.
with transaction.atomic(): with transaction.atomic(savepoint=False):
Subscription.objects.filter( Subscription.objects.filter(
id__in=sub_ids_to_deactivate, id__in=sub_ids_to_deactivate,
).update(active=False) ).update(active=False)