When creating a DMP with datasets, add datasets after the DMP is created
This commit is contained in:
parent
f32a3db3b5
commit
7300e2fe85
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue