From f351f9482779565f6c7d0c920df206ab60589a71 Mon Sep 17 00:00:00 2001 From: Prakhar Pratyush Date: Fri, 1 Nov 2024 21:46:32 +0530 Subject: [PATCH] do_change_plan_type: Mark the transaction to not create savepoints. This commit adds 'savepoint=False' to the transaction.atomic decorators of do_change_plan_type as we don't intend to create savepoints when the function is called inside an outer transaction. --- corporate/lib/stripe.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/corporate/lib/stripe.py b/corporate/lib/stripe.py index 00ca44c0f9..c7d91151db 100644 --- a/corporate/lib/stripe.py +++ b/corporate/lib/stripe.py @@ -4006,6 +4006,7 @@ class RealmBillingSession(BillingSession): return customer @override + @transaction.atomic(savepoint=False) def do_change_plan_type( self, *, tier: int | None, is_sponsored: bool = False, background_update: bool = False ) -> None: @@ -4404,7 +4405,7 @@ class RemoteRealmBillingSession(BillingSession): return customer @override - @transaction.atomic + @transaction.atomic(savepoint=False) def do_change_plan_type( self, *, tier: int | None, is_sponsored: bool = False, background_update: bool = False ) -> None: # nocoverage @@ -4841,7 +4842,7 @@ class RemoteServerBillingSession(BillingSession): return customer @override - @transaction.atomic + @transaction.atomic(savepoint=False) def do_change_plan_type( self, *, tier: int | None, is_sponsored: bool = False, background_update: bool = False ) -> None: