Skip to content

Commit 430802c

Browse files
authored
Update umapi.py
to fix #862
1 parent 97e7aef commit 430802c

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

user_sync/engine/umapi.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -840,8 +840,11 @@ def create_umapi_user(self, user_key, groups_to_add, umapi_info, trusted):
840840

841841
def get_from_index(self, index, user_key):
842842
"""Parse user key and try to retrieve user from provided index"""
843-
844-
_, username, _, email = self.parse_user_key(user_key)
843+
try:
844+
_, username, _, email = self.parse_user_key(user_key)
845+
except ValueError:
846+
self.logger.critical("Invalid user_key: {}".format(user_key))
847+
raise ValueError("Check user's email and username in the source directory!")
845848
return index.get(email=email, username=username)
846849

847850
def update_umapi_user(self, umapi_info, user_key, attributes_to_update=None, groups_to_add=None,

0 commit comments

Comments
 (0)