kids can't be team leaders
parent
1f96b01b57
commit
9e7caab741
|
@ -264,7 +264,8 @@ final class TeamApi(
|
|||
def setLeaders(team: Team, json: String, by: User, byMod: Boolean): Funit = {
|
||||
val leaders: Set[User.ID] = parseTagifyInput(json) take 30
|
||||
for {
|
||||
ids <- memberRepo.filterUserIdsInTeam(team.id, leaders)
|
||||
allIds <- memberRepo.filterUserIdsInTeam(team.id, leaders)
|
||||
ids <- userRepo.filterNotKid(allIds.toSeq)
|
||||
previousValidLeaders <- memberRepo.filterUserIdsInTeam(team.id, team.leaders)
|
||||
_ <- ids.nonEmpty ?? {
|
||||
if (
|
||||
|
|
|
@ -381,6 +381,9 @@ final class UserRepo(val coll: Coll)(implicit ec: scala.concurrent.ExecutionCont
|
|||
def filterLame(ids: Seq[ID]): Fu[Set[ID]] =
|
||||
coll.distinct[ID, Set]("_id", Some($inIds(ids) ++ lame))
|
||||
|
||||
def filterNotKid(ids: Seq[ID]): Fu[Set[ID]] =
|
||||
coll.distinct[ID, Set]("_id", Some($inIds(ids) ++ $doc(F.kid $ne true)))
|
||||
|
||||
def isTroll(id: ID): Fu[Boolean] = coll.exists($id(id) ++ trollSelect(true))
|
||||
|
||||
def isCreatedSince(id: ID, since: DateTime): Fu[Boolean] =
|
||||
|
|
Loading…
Reference in New Issue