Removed unnecessary condition when retrieving DMPs

This commit is contained in:
George Kalampokis 2020-04-21 17:54:00 +03:00
parent 744acd7abf
commit ef40c5568f
1 changed files with 1 additions and 2 deletions

View File

@ -161,8 +161,7 @@ public class DataManagementPlanManager {
item.setDataset(
item.getDataset().stream()
.filter(dataset -> !dataset.getStatus().equals(Dataset.Status.DELETED.getValue()) && !dataset.getStatus().equals(Dataset.Status.CANCELED.getValue())).collect(Collectors.toList()).stream()
.filter(dataset -> dataset.getDmp().getUsers().stream().filter(userDMP -> userDMP.getRole().equals(UserDMP.UserDMPRoles.OWNER.getValue())).findFirst().get().getUser().getId().equals(principalID)
|| dataset.getDmp().getUsers().stream()
.filter(dataset -> dataset.getDmp().getUsers().stream()
.filter(x -> x.getUser().getId().equals(principalID))
.collect(Collectors.toList()).size() > 0)
.collect(Collectors.toSet()));