diff --git a/api/src/org/labkey/api/security/UserManager.java b/api/src/org/labkey/api/security/UserManager.java index e9be0dd6f1e..fd712817e7e 100644 --- a/api/src/org/labkey/api/security/UserManager.java +++ b/api/src/org/labkey/api/security/UserManager.java @@ -1181,10 +1181,16 @@ public static List parseUserListInput(Set theList) { if (null == (name = StringUtils.trimToNull(name))) continue; - User u = null; - try { u = getUser(new ValidEmail(name)); } catch (ValidEmail.InvalidEmailException ignored) {} - if (null == u) - u = getUserByDisplayName(name); + // First try by display name. See issue 40987 + User u = getUserByDisplayName(name); + if (u == null) + { + try + { + u = getUser(new ValidEmail(name)); + } + catch (ValidEmail.InvalidEmailException ignored) {} + } parsed.add(null == u ? name : String.valueOf(u.getUserId())); } return parsed;