When merging users delete the remaining credentials of the user to be
merged
This commit is contained in:
parent
d77fefc7c5
commit
03da1f3f7b
|
@ -91,6 +91,12 @@ public class MergeEmailConfirmationManager {
|
||||||
});
|
});
|
||||||
oldUser.setUserStatus((short)1);
|
oldUser.setUserStatus((short)1);
|
||||||
oldUser.setEmail(null);
|
oldUser.setEmail(null);
|
||||||
|
List<Credential> credentials = databaseRepository.getCredentialDao().asQueryable().where((builder, root) -> builder.equal(root.get("userInfo"), oldUser)).toList();
|
||||||
|
credentials.forEach(cred -> {
|
||||||
|
if (cred.getId() != credential.getId()) {
|
||||||
|
databaseRepository.getCredentialDao().delete(cred);
|
||||||
|
}
|
||||||
|
});
|
||||||
databaseRepository.getUserInfoDao().createOrUpdate(oldUser);
|
databaseRepository.getUserInfoDao().createOrUpdate(oldUser);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue