Merge pull request #669 from lakshani/reenrollment-device

Fixed jira IOTS-438
revert-70aa11f8
Harshan Liyanage 8 years ago committed by GitHub
commit 52455b4c40

@ -269,7 +269,9 @@ public class DeviceManagementProviderServiceImpl implements DeviceManagementProv
DeviceManagementDAOFactory.beginTransaction(); DeviceManagementDAOFactory.beginTransaction();
Device currentDevice = deviceDAO.getDevice(deviceIdentifier, tenantId); Device currentDevice = deviceDAO.getDevice(deviceIdentifier, tenantId);
device.setId(currentDevice.getId()); device.setId(currentDevice.getId());
device.getEnrolmentInfo().setId(currentDevice.getEnrolmentInfo().getId()); if (device.getEnrolmentInfo().getId() == 0) {
device.getEnrolmentInfo().setId(currentDevice.getEnrolmentInfo().getId());
}
if (device.getName() == null) { if (device.getName() == null) {
device.setName(currentDevice.getName()); device.setName(currentDevice.getName());
} }

Loading…
Cancel
Save