Skip to content

Commit 795345e

Browse files
committed
change how domain is set for UserAction
1 parent 0cd53db commit 795345e

2 files changed

Lines changed: 6 additions & 2 deletions

File tree

user_sync/connector/connector_umapi.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -326,9 +326,15 @@ def get_next_request_id(self):
326326
return request_id
327327

328328
def create_action(self, commands):
329+
# "user" field identifies the user in the action command it is
330+
# either email or username
329331
user = commands.user
330332
domain = commands.domain
331333

334+
# cannot construct the action if domain is not None and there is an
335+
# email-like identifier in use
336+
if '@' in user:
337+
domain = None
332338
try:
333339
action = umapi_client.UserAction(user, domain,
334340
requestID=self.get_next_request_id())

user_sync/engine/umapi.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -670,8 +670,6 @@ def get_commands(key):
670670
id_type, username, domain, _ = self.parse_user_key(key)
671671
if '@' in username and username.lower() in self.email_override:
672672
username = self.email_override[username.lower()]
673-
if not domain:
674-
domain = None
675673
return user_sync.connector.connector_umapi.Commands(username, domain)
676674

677675
# do the secondary umapis first, in case we are deleting user accounts from the primary umapi at the end

0 commit comments

Comments
 (0)