From ca4760a04c90f18bce3ed109043488416822f899 Mon Sep 17 00:00:00 2001 From: Prakhar Pratyush Date: Mon, 4 Nov 2024 11:15:56 +0530 Subject: [PATCH] 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. --- zerver/models/recipients.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/zerver/models/recipients.py b/zerver/models/recipients.py index 38a4bc5c8f..c49f5d774f 100644 --- a/zerver/models/recipients.py +++ b/zerver/models/recipients.py @@ -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),