refuse to serve old puzzles
so we can't be blamed for having them even tho we never show them to anyonepull/7528/head
parent
231b94df84
commit
7397df4d4c
|
@ -2,12 +2,12 @@ package controllers
|
|||
|
||||
import play.api.libs.json._
|
||||
import scala.util.chaining._
|
||||
import views._
|
||||
|
||||
import lila.api.Context
|
||||
import lila.app._
|
||||
import lila.common.config.MaxPerSecond
|
||||
import lila.puzzle.{ PuzzleId, Result, Puzzle => PuzzleModel, UserInfos }
|
||||
import views._
|
||||
|
||||
final class Puzzle(
|
||||
env: Env,
|
||||
|
@ -64,6 +64,8 @@ final class Puzzle(
|
|||
|
||||
def show(id: PuzzleId) =
|
||||
Open { implicit ctx =>
|
||||
if (id < env.puzzle.idMin) notFound
|
||||
else
|
||||
NoBot {
|
||||
OptionFuResult(env.puzzle.api.puzzle find id) { puzzle =>
|
||||
renderShow(puzzle, "play")
|
||||
|
|
|
@ -47,6 +47,8 @@ final class Env(
|
|||
|
||||
private lazy val gameJson = wire[GameJson]
|
||||
|
||||
val idMin = config.puzzleIdMin
|
||||
|
||||
lazy val jsonView = wire[JsonView]
|
||||
|
||||
lazy val api = new PuzzleApi(
|
||||
|
|
Loading…
Reference in New Issue