Fixes bug on DMP update not being ableto remove Funder.

This commit is contained in:
gkolokythas 2019-08-27 18:02:44 +03:00
parent bca715d52b
commit d5970126d2
2 changed files with 4 additions and 1 deletions

View File

@ -457,7 +457,7 @@ public class DataManagementPlanManager {
if (newDmp.getGrant().getId() != null) {
Grant grant = apiContext.getOperationsContext().getDatabaseRepository().getGrantDao().find(newDmp.getGrant().getId());
if (grant.getFunder() != null
if (grant.getFunder() != null && newDmp.getGrant().getFunder() != null
&& !grant.getFunder().getId().equals(newDmp.getGrant().getFunder().getId())
&& !grant.getCreationUser().getId().equals(user.getId())){
throw new Exception("User is not the owner of the Grant, therefore, cannot edit it");

View File

@ -309,6 +309,9 @@ public class DataManagementPlanEditorModel implements DataModel<DMP, DataManagem
dataManagementPlanEntity.getGrant().setFunder(funder);
}
}
else {
dataManagementPlanEntity.getGrant().setFunder(null);
}
if (this.project != null) {
if (this.project.getExistProject() != null && this.project.getLabel() == null && this.project.getDescription() == null)