Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 6 additions & 4 deletions umapi_client/functional.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand Down