From daf44ff834b2f03c8ed908b7bf0fe6f06d5af24a Mon Sep 17 00:00:00 2001 From: hiranya911 Date: Fri, 13 Sep 2019 10:54:14 -0700 Subject: [PATCH] Handling the EMAIL_EXISTS error code --- firebase_admin/_auth_utils.py | 1 + tests/test_user_mgt.py | 1 + 2 files changed, 2 insertions(+) diff --git a/firebase_admin/_auth_utils.py b/firebase_admin/_auth_utils.py index d90b494f5..bdba9f81d 100644 --- a/firebase_admin/_auth_utils.py +++ b/firebase_admin/_auth_utils.py @@ -257,6 +257,7 @@ def __init__(self, message, cause=None, http_response=None): _CODE_TO_EXC_TYPE = { 'DUPLICATE_EMAIL': EmailAlreadyExistsError, 'DUPLICATE_LOCAL_ID': UidAlreadyExistsError, + 'EMAIL_EXISTS': EmailAlreadyExistsError, 'INVALID_DYNAMIC_LINK_DOMAIN': InvalidDynamicLinkDomainError, 'INVALID_ID_TOKEN': InvalidIdTokenError, 'PHONE_NUMBER_EXISTS': PhoneNumberAlreadyExistsError, diff --git a/tests/test_user_mgt.py b/tests/test_user_mgt.py index a971c40a0..3c19a98d8 100644 --- a/tests/test_user_mgt.py +++ b/tests/test_user_mgt.py @@ -292,6 +292,7 @@ class TestCreateUser(object): already_exists_errors = { 'DUPLICATE_EMAIL': auth.EmailAlreadyExistsError, 'DUPLICATE_LOCAL_ID': auth.UidAlreadyExistsError, + 'EMAIL_EXISTS': auth.EmailAlreadyExistsError, 'PHONE_NUMBER_EXISTS': auth.PhoneNumberAlreadyExistsError, }