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
|
||||
return redirect Index if not @state["user"]
|
||||
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
|
||||
end
|
||||
|
||||
def post
|
||||
user = User.find(@state["user"].id)
|
||||
user = @state["user"]
|
||||
raise "unknown user" if user.nil?
|
||||
user.email = @input.email
|
||||
user.prize = !@input.prize.nil?
|
||||
|
|
Reference in New Issue