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

'get_or_create_direct_message_group' is used inside an outer
db transaction created in 'edit_scheduled_message'.

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

This commit adds `savepoint=False` to avoid that.
This commit is contained in:
Prakhar Pratyush 2024-11-04 11:15:56 +05:30 committed by Tim Abbott
parent 0e67e4f1a1
commit ca4760a04c
1 changed files with 1 additions and 1 deletions

View File

@ -165,7 +165,7 @@ def get_or_create_direct_message_group(id_list: list[int]) -> DirectMessageGroup
from zerver.models import Subscription, UserProfile
direct_message_group_hash = get_direct_message_group_hash(id_list)
with transaction.atomic():
with transaction.atomic(savepoint=False):
(direct_message_group, created) = DirectMessageGroup.objects.get_or_create(
huddle_hash=direct_message_group_hash,
group_size=len(id_list),