Condition on the userState instead of the dates. (#14950)

Co-authored-by: Lucas Bach Bisgaard <lom@novicell.dk>
This commit is contained in:
Lucas Bach Bisgaard
2023-10-22 19:25:51 +02:00
committed by GitHub
parent ed006931a4
commit d749731413

View File

@@ -532,7 +532,7 @@ public class UsersController : BackOfficeNotificationsController
{
// first validate the username if we're showing it
ActionResult<IUser?> userResult = CheckUniqueUsername(userSave.Username,
u => u.LastLoginDate != default || u.EmailConfirmedDate.HasValue);
u => u.UserState != UserState.Invited);
if (userResult.Result is not null)
{
return userResult.Result;
@@ -540,7 +540,7 @@ public class UsersController : BackOfficeNotificationsController
}
IUser? user = CheckUniqueEmail(userSave.Email,
u => u.LastLoginDate != default || u.EmailConfirmedDate.HasValue);
u => u.UserState != UserState.Invited);
if (ModelState.IsValid == false)
{