diff --git a/zerver/actions/invites.py b/zerver/actions/invites.py index 2197ac0da3..11534c7127 100644 --- a/zerver/actions/invites.py +++ b/zerver/actions/invites.py @@ -173,7 +173,7 @@ def check_invite_limit(realm: Realm, num_invitees: int) -> None: ) -@transaction.atomic +@transaction.atomic(durable=True) def do_invite_users( user_profile: UserProfile, invitee_emails: Collection[str], @@ -414,7 +414,7 @@ def do_revoke_multi_use_invite(multiuse_invite: MultiuseInvite) -> None: notify_invites_changed(realm, changed_invite_referrer=multiuse_invite.referred_by) -@transaction.atomic +@transaction.atomic(savepoint=False) def do_send_user_invite_email( prereg_user: PreregistrationUser, *, diff --git a/zerver/lib/send_email.py b/zerver/lib/send_email.py index 8803672843..348e192565 100644 --- a/zerver/lib/send_email.py +++ b/zerver/lib/send_email.py @@ -378,7 +378,7 @@ def send_future_email( # For logging the email assert (to_user_ids is None) ^ (to_emails is None) - with transaction.atomic(): + with transaction.atomic(savepoint=False): email = ScheduledEmail.objects.create( type=EMAIL_TYPES[template_name], scheduled_timestamp=timezone_now() + delay,