From 432fb3fcf7f1e9d7afd67683c1cfb350b0439934 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Adri=C3=A0=20Casaj=C3=BAs?= Date: Mon, 13 Mar 2023 14:57:00 +0100 Subject: [PATCH] Fix: Send different exception for users with an alias as email (#1630) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Adrià Casajús --- app/account_linking.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/account_linking.py b/app/account_linking.py index 96467360..456d197f 100644 --- a/app/account_linking.py +++ b/app/account_linking.py @@ -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(