Prevent to check deleted Datasets when checking which Dataset Templates are in use

This commit is contained in:
George Kalampokis 2020-11-16 18:31:41 +02:00
parent a3d662aed1
commit 1e0b828a48
1 changed files with 1 additions and 1 deletions

View File

@ -366,7 +366,7 @@ public class DataManagementPlanManager {
if (dbTime.toEpochMilli() != modelTime.toEpochMilli()) {
throw new Exception("Another user have already edit that DMP.");
}
List<Dataset> datasetList = new ArrayList<>(dmp1.getDataset());
List<Dataset> datasetList = dmp1.getDataset().stream().filter(dataset -> dataset.getStatus() != 99).collect(Collectors.toList());
for (Dataset dataset : datasetList) {
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.");