Reset default fields of User object before update (#158)

The policies of `User` objects is an empty set by default. So, when using a new `User` object to call `update`, it also updates existing policies to be an empty list.
This commit is contained in:
Shrikant Sharat Kandula 2020-07-24 18:32:43 +05:30 committed by GitHub
parent 9f8b5ca4d8
commit 4a269efd4a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -118,6 +118,9 @@ public class ExamplesOrganizationCloner {
User userUpdate = new User();
userUpdate.setExamplesOrganizationId(newOrganization.getId());
userUpdate.setPasswordResetInitiated(user.getPasswordResetInitiated());
userUpdate.setSource(user.getSource());
userUpdate.setGroupIds(null);
userUpdate.setPolicies(null);
return Mono
.when(
userService.update(user.getId(), userUpdate),