Fix contest creation
Some checks failed
CI / scan_ruby (push) Successful in 18s
CI / scan_js (push) Successful in 14s
CI / lint (push) Successful in 14s
CI / test (push) Failing after 35s

This commit is contained in:
sto
2025-11-18 09:30:40 +01:00
parent e67ee92838
commit 0f725e2eef
3 changed files with 7 additions and 4 deletions

View File

@@ -56,12 +56,15 @@ class ContestsController < ApplicationController
authorize :contest
@contest = Contest.new
@title = I18n.t("contests.new.title")
end
def create
authorize :contest
@contest = Contest.new(new_contest_params)
@contest.lang = @current_user.lang
@contest.ranking_mode = "actual"
@contest.user_id = current_user.id
if @contest.save
redirect_to "/contests/#{@contest.id}/settings/general", notice: t("contests.new.notice")