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