Fixes setting the status of a new version of a published DMP to "published" too.

This commit is contained in:
gkolokythas 2020-01-09 15:43:57 +02:00
parent eba3ee137d
commit 1c58007a9f
1 changed files with 0 additions and 5 deletions

View File

@ -584,11 +584,6 @@ public class DataManagementPlanManager {
if (latestVersionDMP.get(0).getVersion().equals(oldDmp.getVersion())) { if (latestVersionDMP.get(0).getVersion().equals(oldDmp.getVersion())) {
DMP newDmp = dataManagementPlan.toDataModel(); DMP newDmp = dataManagementPlan.toDataModel();
if (oldDmp.isPublic()) {
newDmp.setPublic(true);
newDmp.setFinalizedAt(new Date());
newDmp.setPublishedAt(new Date());
}
UserInfo user = apiContext.getOperationsContext().getBuilderFactory().getBuilder(UserInfoBuilder.class).id(principal.getId()).build(); UserInfo user = apiContext.getOperationsContext().getBuilderFactory().getBuilder(UserInfoBuilder.class).id(principal.getId()).build();
createOrganisationsIfTheyDontExist(newDmp, databaseRepository.getOrganisationDao()); createOrganisationsIfTheyDontExist(newDmp, databaseRepository.getOrganisationDao());
createResearchersIfTheyDontExist(newDmp, databaseRepository.getResearcherDao(), user); createResearchersIfTheyDontExist(newDmp, databaseRepository.getResearcherDao(), user);