reduce nb of commit
This commit is contained in:
parent
e0b5bd36a6
commit
ed12e47077
|
@ -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,
|
||||
|
|
Loading…
Reference in New Issue