|
@@ -6,7 +6,7 @@ from wtforms import StringField, validators
|
|
|
from app import email_utils, config
|
|
|
from app.auth.base import auth_bp
|
|
|
from app.config import URL, DISABLE_REGISTRATION
|
|
|
-from app.email_utils import can_be_used_as_personal_email
|
|
|
+from app.email_utils import can_be_used_as_personal_email, email_already_used
|
|
|
from app.extensions import db
|
|
|
from app.log import LOG
|
|
|
from app.models import User, ActivationCode
|
|
@@ -41,9 +41,7 @@ def register():
|
|
|
"You cannot use this email address as your personal inbox.", "error",
|
|
|
)
|
|
|
else:
|
|
|
- user = User.get_by(email=email)
|
|
|
-
|
|
|
- if user:
|
|
|
+ if email_already_used(email):
|
|
|
flash(f"Email {email} already used", "error")
|
|
|
else:
|
|
|
LOG.debug("create user %s", form.email.data)
|