Fixes bug on Dataset create.
This commit is contained in:
parent
92486b9363
commit
427f8f0595
|
@ -317,7 +317,7 @@ public class DatasetManager {
|
||||||
|
|
||||||
public eu.eudat.data.entities.Dataset createOrUpdate(DatasetWizardModel datasetWizardModel, Principal principal) throws Exception {
|
public eu.eudat.data.entities.Dataset createOrUpdate(DatasetWizardModel datasetWizardModel, Principal principal) throws Exception {
|
||||||
DMP dmp = apiContext.getOperationsContext().getDatabaseRepository().getDmpDao().find(datasetWizardModel.getDmp().getId());
|
DMP dmp = apiContext.getOperationsContext().getDatabaseRepository().getDmpDao().find(datasetWizardModel.getDmp().getId());
|
||||||
if (dmp.getStatus().equals(DMP.DMPStatus.FINALISED.getValue()))
|
if (dmp.getStatus().equals(DMP.DMPStatus.FINALISED.getValue()) && datasetWizardModel.getId() != null)
|
||||||
throw new Exception("DMP is finalized, therefore Dataset cannot be edited.");
|
throw new Exception("DMP is finalized, therefore Dataset cannot be edited.");
|
||||||
eu.eudat.data.entities.Dataset dataset = datasetWizardModel.toDataModel();
|
eu.eudat.data.entities.Dataset dataset = datasetWizardModel.toDataModel();
|
||||||
dataset.setDmp(dmp);
|
dataset.setDmp(dmp);
|
||||||
|
|
Loading…
Reference in New Issue