mirror of https://github.com/zulip/zulip.git
create_user: Add 'durable=True' to the outermost transaction.
We need to specify savepoint=False explicitly in the one subroutine that already specifies a transaction.
This commit is contained in:
parent
50674a7a28
commit
555ac613ac
|
@ -487,6 +487,7 @@ def notify_created_bot(user_profile: UserProfile) -> None:
|
|||
send_event_on_commit(user_profile.realm, event, bot_owner_user_ids(user_profile))
|
||||
|
||||
|
||||
@transaction.atomic(durable=True)
|
||||
def do_create_user(
|
||||
email: str,
|
||||
password: str | None,
|
||||
|
@ -516,7 +517,6 @@ def do_create_user(
|
|||
if settings.BILLING_ENABLED:
|
||||
from corporate.lib.stripe import RealmBillingSession
|
||||
|
||||
with transaction.atomic():
|
||||
user_profile = create_user(
|
||||
email=email,
|
||||
password=password,
|
||||
|
@ -556,9 +556,7 @@ def do_create_user(
|
|||
# If this user just created a realm, make sure they are
|
||||
# properly tagged as the creator of the realm.
|
||||
realm_creation_audit_log = (
|
||||
RealmAuditLog.objects.filter(
|
||||
event_type=AuditLogEventType.REALM_CREATED, realm=realm
|
||||
)
|
||||
RealmAuditLog.objects.filter(event_type=AuditLogEventType.REALM_CREATED, realm=realm)
|
||||
.order_by("id")
|
||||
.last()
|
||||
)
|
||||
|
|
|
@ -229,7 +229,7 @@ def send_welcome_bot_response(send_request: SendMessageRequest) -> None:
|
|||
)
|
||||
|
||||
|
||||
@transaction.atomic
|
||||
@transaction.atomic(savepoint=False)
|
||||
def send_initial_realm_messages(realm: Realm) -> None:
|
||||
# Sends the initial messages for a new organization.
|
||||
#
|
||||
|
|
Loading…
Reference in New Issue