When creating a DMP with datasets, add datasets after the DMP is created

This commit is contained in:
George Kalampokis 2020-09-08 17:50:38 +03:00
parent f32a3db3b5
commit 7300e2fe85
1 changed files with 3 additions and 3 deletions

View File

@ -496,14 +496,14 @@ public class DataManagementPlanManager {
createFunderIfItDoesntExist(tempDMP, apiContext.getOperationsContext().getDatabaseRepository().getFunderDao());
createGrantIfItDoesntExist(tempDMP, apiContext.getOperationsContext().getDatabaseRepository().getGrantDao());
DMP result = createOrUpdate(dataManagementPlan, principal);
for (DatasetWizardModel datasetWizardModel: dataManagementPlan.getDatasets()) {
datasetWizardModel.setDmp(new DataManagementPlan().fromDataModel(tempDMP));
datasetWizardModel.setDmp(new DataManagementPlan().fromDataModel(result));
Dataset dataset = datasetManager.createOrUpdate(datasetWizardModel, principal);
datasets.add(dataset);
}
DMP result = createOrUpdate(dataManagementPlan, principal);
return result;
}