diff --git a/dmp-backend/web/src/main/java/eu/eudat/controllers/QuickWizardController.java b/dmp-backend/web/src/main/java/eu/eudat/controllers/QuickWizardController.java index 044700940..adedfcb4f 100644 --- a/dmp-backend/web/src/main/java/eu/eudat/controllers/QuickWizardController.java +++ b/dmp-backend/web/src/main/java/eu/eudat/controllers/QuickWizardController.java @@ -44,10 +44,12 @@ public class QuickWizardController extends BaseController { Funder funderEntity; //Create Funder - if (quickWizard.getFunder().getExistFunder() == null - && quickWizard.getFunder().getLabel() == null) { - funderEntity = null; - } else if (quickWizard.getFunder().getExistFunder() == null && quickWizard.getFunder().getLabel() != null){ + if (quickWizard.getFunder() == null) { + throw new Exception("Funder is a mandatory entity"); + } else if (quickWizard.getFunder().getExistFunder() == null && quickWizard.getFunder().getLabel() == null) { + // funderEntity = null; + throw new Exception("Funder is a mandatory entity"); + } else if (quickWizard.getFunder().getExistFunder() == null && quickWizard.getFunder().getLabel() != null) { funderEntity = this.quickWizardManager.createOrUpdate(quickWizard.getFunder().toDataFunder(), principal); } else { funderEntity = quickWizard.getFunder().getExistFunder().toDataModel(); @@ -90,8 +92,6 @@ public class QuickWizardController extends BaseController { return ResponseEntity.status(HttpStatus.OK).body(new ResponseItem().status(ApiMessageCode.SUCCESS_MESSAGE).message("Created")); } - - @RequestMapping(method = RequestMethod.POST, value = {"/datasetcreate"}, consumes = "application/json", produces = "application/json") public @ResponseBody ResponseEntity> addDatasetWizard(@RequestBody DatasetCreateWizardModel datasetCreateWizardModel, Principal principal) throws Exception{ @@ -101,5 +101,4 @@ public class QuickWizardController extends BaseController { return ResponseEntity.status(HttpStatus.OK).body(new ResponseItem().status(ApiMessageCode.SUCCESS_MESSAGE).message("Dataset added!")); } - } diff --git a/dmp-backend/web/src/main/java/eu/eudat/models/data/dmp/DataManagementPlanEditorModel.java b/dmp-backend/web/src/main/java/eu/eudat/models/data/dmp/DataManagementPlanEditorModel.java index cd886dfff..8a9d283e9 100644 --- a/dmp-backend/web/src/main/java/eu/eudat/models/data/dmp/DataManagementPlanEditorModel.java +++ b/dmp-backend/web/src/main/java/eu/eudat/models/data/dmp/DataManagementPlanEditorModel.java @@ -293,13 +293,13 @@ public class DataManagementPlanEditorModel implements DataModel