Merge branch 'dmp-refactoring' of https://code-repo.d4science.org/MaDgiK-CITE/argos into dmp-refactoring

This commit is contained in:
Diamantis Tziotzios 2024-06-21 16:52:30 +03:00
commit e924270c88
1 changed files with 4 additions and 1 deletions

View File

@ -1011,6 +1011,9 @@ public class UserServiceImpl implements UserService {
} }
this.addUserToTenant(tenantEntity, userInviteToTenantRequest); this.addUserToTenant(tenantEntity, userInviteToTenantRequest);
action.setStatus(ActionConfirmationStatus.Accepted);
this.entityManager.merge(action);
} }
private void addUserToTenant(TenantEntity tenant, UserInviteToTenantRequestEntity userInviteToTenantRequest) throws InvalidApplicationException { private void addUserToTenant(TenantEntity tenant, UserInviteToTenantRequestEntity userInviteToTenantRequest) throws InvalidApplicationException {
@ -1023,8 +1026,8 @@ public class UserServiceImpl implements UserService {
if (contactInfoEntity != null){ if (contactInfoEntity != null){
userId = contactInfoEntity.getUserId(); userId = contactInfoEntity.getUserId();
} }
if (userId != null) { if (userId != null) {
if (!userId.equals(this.userScope.getUserId())) throw new MyApplicationException("Cannot confirm invitation for different User");
UserCredentialEntity userCredential = this.queryFactory.query(UserCredentialQuery.class).disableTracking().userIds(userId).first(); UserCredentialEntity userCredential = this.queryFactory.query(UserCredentialQuery.class).disableTracking().userIds(userId).first();
if (userCredential == null) throw new MyApplicationException(); if (userCredential == null) throw new MyApplicationException();