Fix public contestant form URLs creations (token -> contestant_id)
This commit is contained in:
@@ -154,7 +154,7 @@ class ContestantsController < ApplicationController
|
|||||||
@completion.completed = true
|
@completion.completed = true
|
||||||
@public = true
|
@public = true
|
||||||
|
|
||||||
render "completions/_form", locals: { completion: @completion, submit_text: t("helpers.buttons.create"), method: :post, url: "/public/p/#{params[:token]}" }
|
render "completions/_form", locals: { completion: @completion, submit_text: t("helpers.buttons.create"), method: :post, url: "/public/p/#{params[:contestant_id]}" }
|
||||||
end
|
end
|
||||||
|
|
||||||
def post_public_completion
|
def post_public_completion
|
||||||
@@ -176,14 +176,14 @@ class ContestantsController < ApplicationController
|
|||||||
end
|
end
|
||||||
if @completion.save
|
if @completion.save
|
||||||
extend_completions!(@completion.contestant)
|
extend_completions!(@completion.contestant)
|
||||||
redirect_to "/public/p/#{params[:token]}/updated"
|
redirect_to "/public/p/#{params[:contestant_id]}/updated"
|
||||||
else
|
else
|
||||||
@puzzles = @contest.puzzles
|
@puzzles = @contest.puzzles
|
||||||
@public = true
|
@public = true
|
||||||
if to_modify
|
if to_modify
|
||||||
@completion.code = nil
|
@completion.code = nil
|
||||||
end
|
end
|
||||||
render "completions/_form", locals: { completion: @completion, submit_text: t("helpers.buttons.create"), method: :post, url: "/public/p/#{params[:token]}" }, status: :unprocessable_entity
|
render "completions/_form", locals: { completion: @completion, submit_text: t("helpers.buttons.create"), method: :post, url: "/public/p/#{params[:contestant_id]}" }, status: :unprocessable_entity
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user