Fixes bug not setting Creation user on Grant.

This commit is contained in:
gkolokythas 2019-08-29 12:35:02 +03:00
parent 3140cf62bd
commit 2d36450e55
2 changed files with 3 additions and 3 deletions

View File

@ -464,6 +464,9 @@ public class DataManagementPlanManager {
}
}
if (newDmp.getGrant().getCreationUser() == null) {
newDmp.getGrant().setCreationUser(user);
}
apiContext.getOperationsContext().getDatabaseRepository().getGrantDao().createOrUpdate(newDmp.getGrant());
newDmp = apiContext.getOperationsContext().getDatabaseRepository().getDmpDao().createOrUpdate(newDmp);

View File

@ -288,9 +288,6 @@ public class DataManagementPlanEditorModel implements DataModel<DMP, DataManagem
grant.setStatus(Grant.Status.ACTIVE.getValue());
grant.setModified(new Date());
grant.setDescription(this.grant.getDescription());
UserInfo userInfo = new UserInfo();
userInfo.setId(this.users.stream().filter(userInfoListingModel -> ((Integer) userInfoListingModel.getRole()).equals(UserDMP.UserDMPRoles.OWNER.getValue())).findFirst().get().getId());
grant.setCreationUser(userInfo);
dataManagementPlanEntity.setGrant(grant);
}