reduce nb of commit

This commit is contained in:
Son 2022-03-10 08:33:26 +01:00
parent e0b5bd36a6
commit ed12e47077
1 changed files with 2 additions and 2 deletions

View File

@ -1401,7 +1401,6 @@ def handle_bounce_forward_phase(msg: Message, email_log: EmailLog):
f"Disable alias {alias} because {reason}. {alias.mailboxes} {alias.user}. Last contact {contact}"
)
alias.enabled = False
Session.commit()
Notification.create(
user_id=user.id,
@ -1409,9 +1408,10 @@ def handle_bounce_forward_phase(msg: Message, email_log: EmailLog):
message=Notification.render(
"notification/alias-disable.html", alias=alias, mailbox=mailbox
),
commit=True,
)
Session.commit()
send_email_with_rate_control(
user,
ALERT_BOUNCE_EMAIL,