Fixes bug on enabling a Finalized DMP to be made Draft again.
This commit is contained in:
parent
e76eb24dbd
commit
c5d00b9ba1
|
@ -424,9 +424,12 @@ public class DataManagementPlanManager {
|
||||||
createOrganisationsIfTheyDontExist(newDmp, apiContext.getOperationsContext().getDatabaseRepository().getOrganisationDao());
|
createOrganisationsIfTheyDontExist(newDmp, apiContext.getOperationsContext().getDatabaseRepository().getOrganisationDao());
|
||||||
createResearchersIfTheyDontExist(newDmp, apiContext.getOperationsContext().getDatabaseRepository().getResearcherDao());
|
createResearchersIfTheyDontExist(newDmp, apiContext.getOperationsContext().getDatabaseRepository().getResearcherDao());
|
||||||
createProjectIfItDoesntExist(newDmp, apiContext.getOperationsContext().getDatabaseRepository().getProjectDao(), user);
|
createProjectIfItDoesntExist(newDmp, apiContext.getOperationsContext().getDatabaseRepository().getProjectDao(), user);
|
||||||
|
DMP dmp = apiContext.getOperationsContext().getDatabaseRepository().getDmpDao().find(dataManagementPlan.getId());
|
||||||
|
|
||||||
|
if (dmp.getStatus().equals(DMP.DMPStatus.FINALISED.getValue()))
|
||||||
|
newDmp.setStatus(DMP.DMPStatus.FINALISED.getValue());
|
||||||
|
|
||||||
try {
|
try {
|
||||||
DMP dmp = apiContext.getOperationsContext().getDatabaseRepository().getDmpDao().find(dataManagementPlan.getId());
|
|
||||||
newDmp.setCreated(dmp.getCreated());
|
newDmp.setCreated(dmp.getCreated());
|
||||||
if (dmp.getUsers().stream().filter(userInfo -> userInfo.getUser().getId() == principal.getId())
|
if (dmp.getUsers().stream().filter(userInfo -> userInfo.getUser().getId() == principal.getId())
|
||||||
.collect(Collectors.toList()).size() == 0) {
|
.collect(Collectors.toList()).size() == 0) {
|
||||||
|
|
Loading…
Reference in New Issue