Make sure the Finish page can only be completed once.

This commit is contained in:
Bram Senders 2010-05-28 18:12:03 +02:00
parent a2f0c254b7
commit 243041c592
1 changed files with 2 additions and 2 deletions

View File

@ -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?