mirror of https://github.com/zulip/zulip.git
process_downgrade: Add savepoint=False to avoid creating savepoint.
'process_downgrade' is used inside an outer db transaction created in 'remote_server_post_analytics'. `transaction.atomic()` block in 'process_downgrade' resulted in savepoint creation. This commit adds `savepoint=False` to avoid that.
This commit is contained in:
parent
86a909e703
commit
75edce59c1
|
@ -4540,7 +4540,7 @@ class RemoteRealmBillingSession(BillingSession):
|
||||||
def process_downgrade(
|
def process_downgrade(
|
||||||
self, plan: CustomerPlan, background_update: bool = False
|
self, plan: CustomerPlan, background_update: bool = False
|
||||||
) -> None: # nocoverage
|
) -> None: # nocoverage
|
||||||
with transaction.atomic():
|
with transaction.atomic(savepoint=False):
|
||||||
old_plan_type = self.remote_realm.plan_type
|
old_plan_type = self.remote_realm.plan_type
|
||||||
new_plan_type = RemoteRealm.PLAN_TYPE_SELF_MANAGED
|
new_plan_type = RemoteRealm.PLAN_TYPE_SELF_MANAGED
|
||||||
self.remote_realm.plan_type = new_plan_type
|
self.remote_realm.plan_type = new_plan_type
|
||||||
|
@ -4967,7 +4967,7 @@ class RemoteServerBillingSession(BillingSession):
|
||||||
def process_downgrade(
|
def process_downgrade(
|
||||||
self, plan: CustomerPlan, background_update: bool = False
|
self, plan: CustomerPlan, background_update: bool = False
|
||||||
) -> None: # nocoverage
|
) -> None: # nocoverage
|
||||||
with transaction.atomic():
|
with transaction.atomic(savepoint=False):
|
||||||
old_plan_type = self.remote_server.plan_type
|
old_plan_type = self.remote_server.plan_type
|
||||||
new_plan_type = RemoteZulipServer.PLAN_TYPE_SELF_MANAGED
|
new_plan_type = RemoteZulipServer.PLAN_TYPE_SELF_MANAGED
|
||||||
self.remote_server.plan_type = new_plan_type
|
self.remote_server.plan_type = new_plan_type
|
||||||
|
|
Loading…
Reference in New Issue