format
This commit is contained in:
parent
2978bfb281
commit
7ed77a66b2
|
@ -84,7 +84,9 @@ def auth_register():
|
||||||
|
|
||||||
if DISABLE_REGISTRATION:
|
if DISABLE_REGISTRATION:
|
||||||
return jsonify(error="registration is closed"), 400
|
return jsonify(error="registration is closed"), 400
|
||||||
if not email_domain_can_be_used_as_mailbox(email) or personal_email_already_used(email):
|
if not email_domain_can_be_used_as_mailbox(email) or personal_email_already_used(
|
||||||
|
email
|
||||||
|
):
|
||||||
return jsonify(error=f"cannot use {email} as personal inbox"), 400
|
return jsonify(error=f"cannot use {email} as personal inbox"), 400
|
||||||
|
|
||||||
if not password or len(password) < 8:
|
if not password or len(password) < 8:
|
||||||
|
@ -236,7 +238,9 @@ def auth_facebook():
|
||||||
if not user:
|
if not user:
|
||||||
if DISABLE_REGISTRATION:
|
if DISABLE_REGISTRATION:
|
||||||
return jsonify(error="registration is closed"), 400
|
return jsonify(error="registration is closed"), 400
|
||||||
if not email_domain_can_be_used_as_mailbox(email) or personal_email_already_used(email):
|
if not email_domain_can_be_used_as_mailbox(
|
||||||
|
email
|
||||||
|
) or personal_email_already_used(email):
|
||||||
return jsonify(error=f"cannot use {email} as personal inbox"), 400
|
return jsonify(error=f"cannot use {email} as personal inbox"), 400
|
||||||
|
|
||||||
LOG.d("create facebook user with %s", user_info)
|
LOG.d("create facebook user with %s", user_info)
|
||||||
|
@ -288,7 +292,9 @@ def auth_google():
|
||||||
if not user:
|
if not user:
|
||||||
if DISABLE_REGISTRATION:
|
if DISABLE_REGISTRATION:
|
||||||
return jsonify(error="registration is closed"), 400
|
return jsonify(error="registration is closed"), 400
|
||||||
if not email_domain_can_be_used_as_mailbox(email) or personal_email_already_used(email):
|
if not email_domain_can_be_used_as_mailbox(
|
||||||
|
email
|
||||||
|
) or personal_email_already_used(email):
|
||||||
return jsonify(error=f"cannot use {email} as personal inbox"), 400
|
return jsonify(error=f"cannot use {email} as personal inbox"), 400
|
||||||
|
|
||||||
LOG.d("create Google user with %s", user_info)
|
LOG.d("create Google user with %s", user_info)
|
||||||
|
|
|
@ -7,7 +7,10 @@ from app import email_utils, config
|
||||||
from app.auth.base import auth_bp
|
from app.auth.base import auth_bp
|
||||||
from app.auth.views.login_utils import get_referral
|
from app.auth.views.login_utils import get_referral
|
||||||
from app.config import URL
|
from app.config import URL
|
||||||
from app.email_utils import email_domain_can_be_used_as_mailbox, personal_email_already_used
|
from app.email_utils import (
|
||||||
|
email_domain_can_be_used_as_mailbox,
|
||||||
|
personal_email_already_used,
|
||||||
|
)
|
||||||
from app.extensions import db
|
from app.extensions import db
|
||||||
from app.log import LOG
|
from app.log import LOG
|
||||||
from app.models import User, ActivationCode
|
from app.models import User, ActivationCode
|
||||||
|
|
|
@ -12,7 +12,10 @@ from wtforms.fields.html5 import EmailField
|
||||||
from app import s3, email_utils
|
from app import s3, email_utils
|
||||||
from app.config import URL
|
from app.config import URL
|
||||||
from app.dashboard.base import dashboard_bp
|
from app.dashboard.base import dashboard_bp
|
||||||
from app.email_utils import email_domain_can_be_used_as_mailbox, personal_email_already_used
|
from app.email_utils import (
|
||||||
|
email_domain_can_be_used_as_mailbox,
|
||||||
|
personal_email_already_used,
|
||||||
|
)
|
||||||
from app.extensions import db
|
from app.extensions import db
|
||||||
from app.log import LOG
|
from app.log import LOG
|
||||||
from app.models import (
|
from app.models import (
|
||||||
|
|
Loading…
Reference in a new issue