Add "public" setting to contests
All checks were successful
CI / scan_ruby (push) Successful in 16s
CI / scan_js (push) Successful in 13s
CI / lint (push) Successful in 13s
CI / test (push) Successful in 35s

This commit is contained in:
sto
2025-06-25 10:07:27 +02:00
parent 1a8ea0afee
commit 2b1a2c9296
9 changed files with 26 additions and 5 deletions

View File

@@ -67,7 +67,7 @@ class ContestsController < ApplicationController
def scoreboard
@contest = Contest.find_by(slug: params[:id])
unless @contest
unless @contest && @contest.public
skip_authorization
not_found and return
end
@@ -94,6 +94,6 @@ class ContestsController < ApplicationController
end
def contest_params
params.expect(contest: [ :lang, :name, :team, :allow_registration ])
params.expect(contest: [ :lang, :name, :public, :team, :allow_registration ])
end
end