diff --git a/app/dashboard/views/custom_alias.py b/app/dashboard/views/custom_alias.py index d516c4b7..e575cef0 100644 --- a/app/dashboard/views/custom_alias.py +++ b/app/dashboard/views/custom_alias.py @@ -41,7 +41,7 @@ def custom_alias(): else: # create the new alias LOG.d("create custom alias %s for user %s", full_email, current_user) - GenEmail.create(email=full_email, user_id=current_user.id) + GenEmail.create(email=full_email, user_id=current_user.id, custom=True) db.session.commit() flash(f"Email alias {full_email} has been created", "success") diff --git a/app/oauth/views/authorize.py b/app/oauth/views/authorize.py index f02fad25..516d061e 100644 --- a/app/oauth/views/authorize.py +++ b/app/oauth/views/authorize.py @@ -123,7 +123,9 @@ def authorize(): email = f"{convert_to_id(custom_email_prefix)}.{email_suffix}@{EMAIL_DOMAIN}" LOG.d("create custom email alias %s for user %s", email, current_user) - gen_email = GenEmail.create(email=email, user_id=current_user.id) + gen_email = GenEmail.create( + email=email, user_id=current_user.id, custom=True + ) db.session.flush() else: # user picks an email from suggestion if chosen_email != current_user.email: