People: fix, refactor

This commit is contained in:
Maksim Chegulov 2022-09-14 12:59:55 +03:00
parent b04f50fc72
commit 1726057d95
2 changed files with 3 additions and 3 deletions

View File

@ -207,7 +207,7 @@ public class UserController : PeopleControllerBase
if (options != null && !options.IsCorrect)
{
throw new InvalidDataException();
throw new SecurityException(FilesCommonResource.ErrorMessage_InvintationLink);
}
var user = new UserInfo();
@ -220,7 +220,7 @@ public class UserController : PeopleControllerBase
if (user == Constants.LostUser || user.ActivationStatus != EmployeeActivationStatus.Pending)
{
throw new InvalidOperationException();
throw new SecurityException(FilesCommonResource.ErrorMessage_InvintationLink);
}
}

View File

@ -132,7 +132,7 @@ public sealed class UserManagerWrapper
userInfo.WorkFromDate = _tenantUtil.DateTimeNow();
}
if (!_coreBaseSettings.Personal && !fromInviteLink)
if (!_coreBaseSettings.Personal && (!fromInviteLink || updateExising))
{
userInfo.ActivationStatus = !afterInvite ? EmployeeActivationStatus.Pending : EmployeeActivationStatus.Activated;
}