|
@@ -8,10 +8,11 @@ from wtforms.fields.html5 import EmailField
|
|
|
from app.config import EMAIL_DOMAIN, ALIAS_DOMAINS, MAILBOX_SECRET, URL
|
|
|
from app.dashboard.base import dashboard_bp
|
|
|
from app.email_utils import (
|
|
|
- send_email,
|
|
|
- render,
|
|
|
can_be_used_as_personal_email,
|
|
|
email_already_used,
|
|
|
+ mailbox_already_used,
|
|
|
+ render,
|
|
|
+ send_email,
|
|
|
)
|
|
|
from app.extensions import db
|
|
|
from app.log import LOG
|
|
@@ -80,7 +81,7 @@ def mailbox_route():
|
|
|
if new_mailbox_form.validate():
|
|
|
mailbox_email = new_mailbox_form.email.data.lower()
|
|
|
|
|
|
- if email_already_used(mailbox_email):
|
|
|
+ if mailbox_already_used(mailbox_email, current_user):
|
|
|
flash(f"{mailbox_email} already used", "error")
|
|
|
elif not can_be_used_as_personal_email(mailbox_email):
|
|
|
flash(f"You cannot use {mailbox_email}.", "error")
|