don't show started private tournaments
This commit is contained in:
parent
4a0542393f
commit
1e4dbd6061
|
@ -47,7 +47,7 @@ object Tournament extends LilaController {
|
|||
}
|
||||
|
||||
private def fetchTournaments =
|
||||
env allCreatedSorted true zip repo.started zip repo.finished(30)
|
||||
env allCreatedSorted true zip repo.noPasswordStarted zip repo.finished(20)
|
||||
|
||||
def show(id: String) = Open { implicit ctx =>
|
||||
repo byId id flatMap {
|
||||
|
|
|
@ -44,6 +44,9 @@ object TournamentRepo {
|
|||
def started: Fu[List[Started]] =
|
||||
coll.find(startedSelect).sort(BSONDocument("createdAt" -> -1)).toList[Started](None)
|
||||
|
||||
def noPasswordStarted: Fu[List[Started]] =
|
||||
coll.find(startedSelect ++ BSONDocument("password" -> BSONDocument("$exists" -> false))).sort(BSONDocument("createdAt" -> -1)).toList[Started](None)
|
||||
|
||||
def finished(limit: Int): Fu[List[Finished]] =
|
||||
coll.find(finishedSelect).sort(BSONDocument("startedAt" -> -1)).toList[Finished](limit.some)
|
||||
|
||||
|
|
Loading…
Reference in a new issue