Fix issue when creating new dataset profile
This commit is contained in:
parent
aca31dc9da
commit
27bf69268e
|
@ -286,11 +286,13 @@ public class DatasetProfileManager {
|
||||||
apiContext.getOperationsContext().getDatabaseRepository().getUserDatasetProfileDao().createOrUpdate(userDatasetProfile1);
|
apiContext.getOperationsContext().getDatabaseRepository().getUserDatasetProfileDao().createOrUpdate(userDatasetProfile1);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
if (entity.getUsers() != null && !entity.getUsers().isEmpty()) {
|
||||||
entity.getUsers().stream().filter(userDatasetProfile -> model.getUsers().stream().filter(userInfoListingModel -> userDatasetProfile.getUser().getId().equals(userInfoListingModel.getId())).count() == 0).forEach(userDatasetProfile -> {
|
entity.getUsers().stream().filter(userDatasetProfile -> model.getUsers().stream().filter(userInfoListingModel -> userDatasetProfile.getUser().getId().equals(userInfoListingModel.getId())).count() == 0).forEach(userDatasetProfile -> {
|
||||||
userDatasetProfile.setRole(2);
|
userDatasetProfile.setRole(2);
|
||||||
apiContext.getOperationsContext().getDatabaseRepository().getUserDatasetProfileDao().createOrUpdate(userDatasetProfile);
|
apiContext.getOperationsContext().getDatabaseRepository().getUserDatasetProfileDao().createOrUpdate(userDatasetProfile);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
public void retrieveUsers(DatasetProfile entity, eu.eudat.models.data.admin.composite.DatasetProfile model) {
|
public void retrieveUsers(DatasetProfile entity, eu.eudat.models.data.admin.composite.DatasetProfile model) {
|
||||||
if (entity.getUsers() != null && !entity.getUsers().isEmpty()) {
|
if (entity.getUsers() != null && !entity.getUsers().isEmpty()) {
|
||||||
|
|
Loading…
Reference in New Issue