Fixes bug on DMP update not being ableto remove Funder.
This commit is contained in:
parent
bca715d52b
commit
d5970126d2
|
@ -457,7 +457,7 @@ public class DataManagementPlanManager {
|
||||||
|
|
||||||
if (newDmp.getGrant().getId() != null) {
|
if (newDmp.getGrant().getId() != null) {
|
||||||
Grant grant = apiContext.getOperationsContext().getDatabaseRepository().getGrantDao().find(newDmp.getGrant().getId());
|
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.getFunder().getId().equals(newDmp.getGrant().getFunder().getId())
|
||||||
&& !grant.getCreationUser().getId().equals(user.getId())){
|
&& !grant.getCreationUser().getId().equals(user.getId())){
|
||||||
throw new Exception("User is not the owner of the Grant, therefore, cannot edit it");
|
throw new Exception("User is not the owner of the Grant, therefore, cannot edit it");
|
||||||
|
|
|
@ -309,6 +309,9 @@ public class DataManagementPlanEditorModel implements DataModel<DMP, DataManagem
|
||||||
dataManagementPlanEntity.getGrant().setFunder(funder);
|
dataManagementPlanEntity.getGrant().setFunder(funder);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
else {
|
||||||
|
dataManagementPlanEntity.getGrant().setFunder(null);
|
||||||
|
}
|
||||||
|
|
||||||
if (this.project != null) {
|
if (this.project != null) {
|
||||||
if (this.project.getExistProject() != null && this.project.getLabel() == null && this.project.getDescription() == null)
|
if (this.project.getExistProject() != null && this.project.getLabel() == null && this.project.getDescription() == null)
|
||||||
|
|
Loading…
Reference in New Issue