diff --git a/backend/core/src/main/java/org/opencdmp/service/user/UserServiceImpl.java b/backend/core/src/main/java/org/opencdmp/service/user/UserServiceImpl.java index 548909b83..94f88743e 100644 --- a/backend/core/src/main/java/org/opencdmp/service/user/UserServiceImpl.java +++ b/backend/core/src/main/java/org/opencdmp/service/user/UserServiceImpl.java @@ -1011,6 +1011,9 @@ public class UserServiceImpl implements UserService { } this.addUserToTenant(tenantEntity, userInviteToTenantRequest); + action.setStatus(ActionConfirmationStatus.Accepted); + this.entityManager.merge(action); + } private void addUserToTenant(TenantEntity tenant, UserInviteToTenantRequestEntity userInviteToTenantRequest) throws InvalidApplicationException { @@ -1023,7 +1026,7 @@ public class UserServiceImpl implements UserService { if (contactInfoEntity != null){ userId = contactInfoEntity.getUserId(); } - + if (userId != this.userScope.getUserId()) throw new MyApplicationException("Cannot confirm invitation for different User"); if (userId != null) { UserCredentialEntity userCredential = this.queryFactory.query(UserCredentialQuery.class).disableTracking().userIds(userId).first(); if (userCredential == null) throw new MyApplicationException();