MapUserProvider should throw an exception for more than one user
Closes #14672
This commit is contained in:
parent
a670e1d965
commit
a62e98f966
1 changed files with 2 additions and 2 deletions
|
@ -505,8 +505,8 @@ public class MapUserProvider implements UserProvider.Streams {
|
||||||
List<MapUserEntity> users = s.collect(Collectors.toList());
|
List<MapUserEntity> users = s.collect(Collectors.toList());
|
||||||
if (users.isEmpty()) return null;
|
if (users.isEmpty()) return null;
|
||||||
if (users.size() != 1) {
|
if (users.size() != 1) {
|
||||||
LOG.warnf("There are colliding usernames for users with usernames and ids: %s",
|
throw new ModelDuplicateException(String.format("There are colliding usernames for users with usernames and ids: %s",
|
||||||
users.stream().collect(Collectors.toMap(MapUserEntity::getUsername, MapUserEntity::getId)));
|
users.stream().collect(Collectors.toMap(MapUserEntity::getUsername, MapUserEntity::getId))));
|
||||||
}
|
}
|
||||||
return entityToAdapterFunc(realm).apply(users.get(0));
|
return entityToAdapterFunc(realm).apply(users.get(0));
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue