Make sure the Finish page can only be completed once.
This commit is contained in:
parent
a2f0c254b7
commit
243041c592
|
@ -128,12 +128,12 @@ module Anne::Controllers
|
||||||
def get
|
def get
|
||||||
return redirect Index if not @state["user"]
|
return redirect Index if not @state["user"]
|
||||||
return redirect Vote unless next_image.first.nil?
|
return redirect Vote unless next_image.first.nil?
|
||||||
# FIXME: check whether email/prize/results have been sent, and redirect to Thanks.
|
return redirect Thanks unless @state["user"].results.nil?
|
||||||
render :finish
|
render :finish
|
||||||
end
|
end
|
||||||
|
|
||||||
def post
|
def post
|
||||||
user = User.find(@state["user"].id)
|
user = @state["user"]
|
||||||
raise "unknown user" if user.nil?
|
raise "unknown user" if user.nil?
|
||||||
user.email = @input.email
|
user.email = @input.email
|
||||||
user.prize = !@input.prize.nil?
|
user.prize = !@input.prize.nil?
|
||||||
|
|
Reference in New Issue