Fix: Send different exception for users with an alias as email (#1630)

Co-authored-by: Adrià Casajús <adria.casajus@proton.ch>
This commit is contained in:
Adrià Casajús 2023-03-13 14:57:00 +01:00 committed by GitHub
parent 44e0dd8635
commit 432fb3fcf7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 2 deletions

View File

@ -11,7 +11,7 @@ from app.email_utils import send_welcome_email
from app.utils import sanitize_email
from app.errors import (
AccountAlreadyLinkedToAnotherPartnerException,
AccountAlreadyLinkedToAnotherUserException,
AccountIsUsingAliasAsEmail,
)
from app.log import LOG
from app.models import (
@ -199,7 +199,7 @@ def get_login_strategy(
def check_alias(email: str) -> bool:
alias = Alias.get_by(email=email)
if alias is not None:
raise AccountAlreadyLinkedToAnotherUserException()
raise AccountIsUsingAliasAsEmail()
def process_login_case(