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