From 64ff8f55a12a1ac56f2f38c3bfec0bb58699b13a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jose=20Garc=C3=ADa?= Date: Fri, 15 Nov 2024 08:38:23 +0100 Subject: [PATCH] Update UsersApi to remove invalid user group assignment in the user update endpoint --- .../src/main/java/org/fao/geonet/api/users/UsersApi.java | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/services/src/main/java/org/fao/geonet/api/users/UsersApi.java b/services/src/main/java/org/fao/geonet/api/users/UsersApi.java index c23134054ec..f590b1945fd 100644 --- a/services/src/main/java/org/fao/geonet/api/users/UsersApi.java +++ b/services/src/main/java/org/fao/geonet/api/users/UsersApi.java @@ -636,10 +636,7 @@ public ResponseEntity updateUser( if (securityProviderConfiguration == null || securityProviderConfiguration.isUserGroupUpdateEnabled()) { setUserGroups(user, groups); } - - user = userRepository.save(user); - setUserGroups(user, groups); - + List userGroups = userGroupRepository.findAll(UserGroupSpecs .hasUserId(user.getId()));