fix #6017
parent
a1ad6eeebc
commit
c95e40e979
|
@ -28,9 +28,9 @@ final class Reopen(
|
|||
fuccess(Left("emailUsed" -> "This email address is already in use by an active account."))
|
||||
case _ =>
|
||||
val userId = User normalize username
|
||||
userRepo.byId(userId) flatMap {
|
||||
userRepo.byIdNotErased(userId) flatMap {
|
||||
case None =>
|
||||
fuccess(Left("noUser" -> "No account has ever been created with this username."))
|
||||
fuccess(Left("noUser" -> "No account found with this username."))
|
||||
case Some(user) if user.enabled =>
|
||||
fuccess(Left("alreadyActive" -> "This account is already active."))
|
||||
case Some(user) =>
|
||||
|
|
|
@ -604,6 +604,8 @@ final class UserRepo(val coll: Coll)(implicit ec: scala.concurrent.ExecutionCont
|
|||
coll.exists($id(user.id) ++ $doc("erasedAt" $exists true))
|
||||
} map User.Erased.apply
|
||||
|
||||
def byIdNotErased(id: ID): Fu[Option[User]] = coll.one[User]($id(id) ++ $doc("erasedAt" $exists false))
|
||||
|
||||
def filterClosedOrInactiveIds(since: DateTime)(ids: Iterable[ID]): Fu[List[ID]] =
|
||||
coll.distinctEasy[ID, List](
|
||||
F.id,
|
||||
|
|
Loading…
Reference in New Issue