From a7ae791f9d67f13425a673e7870ecbb7292d919d Mon Sep 17 00:00:00 2001 From: prathabanKavin Date: Mon, 18 Dec 2023 09:15:04 +0530 Subject: [PATCH] Change deletion warning for users with device --- .../mgt/api/jaxrs/service/impl/UserManagementServiceImpl.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/components/device-mgt/io.entgra.device.mgt.core.device.mgt.api/src/main/java/io/entgra/device/mgt/core/device/mgt/api/jaxrs/service/impl/UserManagementServiceImpl.java b/components/device-mgt/io.entgra.device.mgt.core.device.mgt.api/src/main/java/io/entgra/device/mgt/core/device/mgt/api/jaxrs/service/impl/UserManagementServiceImpl.java index 6d34b2bc6d..cd8063fdca 100644 --- a/components/device-mgt/io.entgra.device.mgt.core.device.mgt.api/src/main/java/io/entgra/device/mgt/core/device/mgt/api/jaxrs/service/impl/UserManagementServiceImpl.java +++ b/components/device-mgt/io.entgra.device.mgt.core.device.mgt.api/src/main/java/io/entgra/device/mgt/core/device/mgt/api/jaxrs/service/impl/UserManagementServiceImpl.java @@ -349,9 +349,9 @@ public class UserManagementServiceImpl implements UserManagementService { } return Response.status(Response.Status.OK).build(); } else { - String msg = "There are enrolled devices for user: " + username + ". Please remove them before deleting the user."; + String msg = "Before deleting this user, ensure there are no devices assigned to the user. You can either remove the devices or change their owner through an update enrollment operation."; log.error(msg); - return Response.status(400).entity(msg).build(); + return Response.status(409).entity(msg).build(); } } catch (DeviceManagementException | UserStoreException e) { String msg = "Exception in trying to remove user by user: " + username;