Use FIRST_ALIAS_DOMAIN to create first alias

This commit is contained in:
Son NK 2020-04-15 22:51:18 +02:00
parent 8ebc26f4e7
commit 28101612db
1 changed files with 2 additions and 1 deletions

View File

@ -21,6 +21,7 @@ from app.config import (
JOB_ONBOARDING_3,
JOB_ONBOARDING_4,
LANDING_PAGE_URL,
FIRST_ALIAS_DOMAIN,
)
from app.extensions import db
from app.log import LOG
@ -622,7 +623,7 @@ class Alias(db.Model, ModelMixin):
# find the right suffix - avoid infinite loop by running this at max 1000 times
for i in range(1000):
suffix = random_word()
email = f"{prefix}.{suffix}@{EMAIL_DOMAIN}"
email = f"{prefix}.{suffix}@{FIRST_ALIAS_DOMAIN}"
if not cls.get_by(email=email):
break