Fixes bug on not creating finalized DMP.
This commit is contained in:
parent
695ce63343
commit
4aedfdd7f6
|
@ -397,9 +397,10 @@ public class DataManagementPlanManager {
|
||||||
|
|
||||||
public void createOrUpdate(ApiContext apiContext, DataManagementPlanEditorModel dataManagementPlan, Principal principal) throws Exception {
|
public void createOrUpdate(ApiContext apiContext, DataManagementPlanEditorModel dataManagementPlan, Principal principal) throws Exception {
|
||||||
|
|
||||||
DMP dmp1 = apiContext.getOperationsContext().getDatabaseRepository().getDmpDao().find(dataManagementPlan.getId());
|
if (dataManagementPlan.getStatus() == (int) DMP.DMPStatus.FINALISED.getValue() && dataManagementPlan.getId() != null) {
|
||||||
if (dmp1.getStatus().equals(DMP.DMPStatus.FINALISED.getValue())) {
|
DMP dmp1 = apiContext.getOperationsContext().getDatabaseRepository().getDmpDao().find(dataManagementPlan.getId());
|
||||||
throw new Exception("DMP is finalized, therefore cannot be edited.");
|
if (dmp1.getStatus().equals(DMP.DMPStatus.FINALISED.getValue()))
|
||||||
|
throw new Exception("DMP is finalized, therefore cannot be edited.");
|
||||||
}
|
}
|
||||||
|
|
||||||
DMP newDmp = dataManagementPlan.toDataModel();
|
DMP newDmp = dataManagementPlan.toDataModel();
|
||||||
|
|
Loading…
Reference in New Issue