From d50a058296ce2a35763eba2c1027cd7e28eb90ea Mon Sep 17 00:00:00 2001 From: Thomas Georgios Giannos Date: Mon, 13 Nov 2023 17:05:25 +0200 Subject: [PATCH] Small fix --- .../main/java/eu/eudat/service/dmp/DmpServiceImpl.java | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/dmp-backend/core/src/main/java/eu/eudat/service/dmp/DmpServiceImpl.java b/dmp-backend/core/src/main/java/eu/eudat/service/dmp/DmpServiceImpl.java index 494053f27..b6b133a93 100644 --- a/dmp-backend/core/src/main/java/eu/eudat/service/dmp/DmpServiceImpl.java +++ b/dmp-backend/core/src/main/java/eu/eudat/service/dmp/DmpServiceImpl.java @@ -316,7 +316,10 @@ public class DmpServiceImpl implements DmpService { public List assignUsers(UUID dmp, List model, FieldSet fieldSet) throws InvalidApplicationException { this.authorizationService.authorizeForce(Permission.AssignDmpUsers); - List existingUsers = this.queryFactory.query(DmpUserQuery.class).dmpIds(dmp).collect(); + List existingUsers = this.queryFactory.query(DmpUserQuery.class) + .dmpIds(dmp) + .isActives(IsActive.Active) + .collect(); for (DmpUserPersist dmpUser : model) { if (checkUserRoleIfExists(existingUsers, dmp, dmpUser.getUser(), dmpUser.getRole())) @@ -340,7 +343,10 @@ public class DmpServiceImpl implements DmpService { this.entityManager.flush(); - return this.queryFactory.query(DmpUserQuery.class).dmpIds().collect(); + return this.queryFactory.query(DmpUserQuery.class) + .dmpIds(dmp) + .isActives(IsActive.Active) + .collect(); } private DmpEntity patchAndSave(DmpPersist model) throws JsonProcessingException, InvalidApplicationException {