Fixes bug on not checking validation rules of a new Finalized DMP. (Issue #131)

This commit is contained in:
gkolokythas 2019-08-22 17:15:16 +03:00
parent 2881ac5dd9
commit 8ad6a8f158
1 changed files with 3 additions and 4 deletions

View File

@ -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());