When creating or updating a DMP with datasets, check the datasets template validity from the datasets of the request and not from the ones in DB
This commit is contained in:
parent
eb7a5571c4
commit
db0cee542c
|
@ -473,8 +473,7 @@ public class DataManagementPlanManager {
|
|||
if (dmp1.getModified().getTime() != dataManagementPlan.getModified().getTime()) {
|
||||
throw new Exception("Another user have already edit that DMP.");
|
||||
}
|
||||
List<Dataset> datasetList = new ArrayList<>(dmp1.getDataset());
|
||||
for (Dataset dataset : datasetList) {
|
||||
for (DatasetWizardModel dataset : dataManagementPlan.getDatasets()) {
|
||||
if (dataManagementPlan.getProfiles().stream().filter(associatedProfile -> dataset.getProfile().getId().equals(associatedProfile.getId())).findAny().orElse(null) == null)
|
||||
throw new Exception("Dataset Template for Dataset Description is missing from the DMP.");
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue