Fixes bug on not checking validation rules of a new Finalized DMP. (Issue #131)
This commit is contained in:
parent
2881ac5dd9
commit
8ad6a8f158
|
@ -420,13 +420,12 @@ public class DataManagementPlanManager {
|
||||||
}
|
}
|
||||||
if (dataManagementPlan.getStatus() == (int) DMP.DMPStatus.FINALISED.getValue() && dmp1.getStatus().equals(DMP.DMPStatus.FINALISED.getValue()))
|
if (dataManagementPlan.getStatus() == (int) DMP.DMPStatus.FINALISED.getValue() && dmp1.getStatus().equals(DMP.DMPStatus.FINALISED.getValue()))
|
||||||
throw new Exception("DMP is finalized, therefore cannot be edited.");
|
throw new Exception("DMP is finalized, therefore cannot be edited.");
|
||||||
|
|
||||||
if(dataManagementPlan.getStatus() == (int) DMP.DMPStatus.FINALISED.getValue()) {
|
|
||||||
checkDmpValidationRules(dmp1);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
DMP newDmp = dataManagementPlan.toDataModel();
|
DMP newDmp = dataManagementPlan.toDataModel();
|
||||||
|
if (newDmp.getStatus() == (int) DMP.DMPStatus.FINALISED.getValue()) {
|
||||||
|
checkDmpValidationRules(newDmp);
|
||||||
|
}
|
||||||
UserInfo user = apiContext.getOperationsContext().getDatabaseRepository().getUserInfoDao().find(principal.getId());
|
UserInfo user = apiContext.getOperationsContext().getDatabaseRepository().getUserInfoDao().find(principal.getId());
|
||||||
|
|
||||||
createOrganisationsIfTheyDontExist(newDmp, apiContext.getOperationsContext().getDatabaseRepository().getOrganisationDao());
|
createOrganisationsIfTheyDontExist(newDmp, apiContext.getOperationsContext().getDatabaseRepository().getOrganisationDao());
|
||||||
|
|
Loading…
Reference in New Issue