Fix Permanent delete for multiple enrollments

This commit is contained in:
Amanda Randombage 2019-10-09 10:19:55 +00:00 committed by Saad Sahibjan
parent 1abc701f20
commit e80589d3b1

View File

@ -533,10 +533,10 @@ public class DeviceManagementProviderServiceImpl implements DeviceManagementProv
try {
DeviceManagementDAOFactory.beginTransaction();
existingDevices = deviceDAO.getDevicesByIdentifiers(deviceIdentifiers, tenantId);
if (existingDevices.size() != deviceIdentifiers.size()) {
for (Device device : existingDevices) {
deviceIdentifiers.remove(device.getDeviceIdentifier());
}
for (Device device : existingDevices) {
deviceIdentifiers.remove(device.getDeviceIdentifier());
}
if (!deviceIdentifiers.isEmpty()) {
String msg =
"Couldn't find device ids for all the requested device identifiers. " +
"Therefore payload should contain device identifiers which are not in the system. " +