From b5db47b2693e489e72a513a8fa8e57ea7efb5c7f Mon Sep 17 00:00:00 2001 From: Lucian N Date: Fri, 29 Jul 2022 09:43:59 +0300 Subject: [PATCH 1/2] Update functional.py - fixes #102 Fixes #102 --- umapi_client/functional.py | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/umapi_client/functional.py b/umapi_client/functional.py index 1948db7..f1651d7 100644 --- a/umapi_client/functional.py +++ b/umapi_client/functional.py @@ -103,13 +103,15 @@ def __init__(self, id_type=IdentityTypes.adobeID, email=None, username=None, dom raise ArgumentError("No user identity specified.") elif not domain: raise ArgumentError("Both username and domain must be specified") - - if username: - Action.__init__(self, user=username, domain=self.domain, **kwargs) - elif id_type == IdentityTypes.adobeID: + + if id_type == IdentityTypes.adobeID: # by default if two users have the same email address, the UMAPI server will prefer the matching # Federated or Enterprise ID user; so we use the undocumented option to prefer the AdobeID match Action.__init__(self, user=email, useAdobeID=True, **kwargs) + elif username and '@' in username: + Action.__init__(self, user=username, **kwargs) + elif username and '@' not in username:: + Action.__init__(self, user=username, domain=self.domain, **kwargs) else: Action.__init__(self, user=email, **kwargs) From a73a1ecf9628e73fd556c99428da0a6a874bb77c Mon Sep 17 00:00:00 2001 From: Lucian N Date: Thu, 4 Aug 2022 01:24:10 +0300 Subject: [PATCH 2/2] Update functional.py --- umapi_client/functional.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/umapi_client/functional.py b/umapi_client/functional.py index f1651d7..760d6d4 100644 --- a/umapi_client/functional.py +++ b/umapi_client/functional.py @@ -110,7 +110,7 @@ def __init__(self, id_type=IdentityTypes.adobeID, email=None, username=None, dom Action.__init__(self, user=email, useAdobeID=True, **kwargs) elif username and '@' in username: Action.__init__(self, user=username, **kwargs) - elif username and '@' not in username:: + elif username and '@' not in username: Action.__init__(self, user=username, domain=self.domain, **kwargs) else: Action.__init__(self, user=email, **kwargs)