small fix

This commit is contained in:
amentis 2024-06-21 16:27:29 +03:00
parent b89df00925
commit d2d889f011
1 changed files with 4 additions and 1 deletions

View File

@ -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();