diff --git a/anne-survey.rb b/anne-survey.rb index 0e7d4fb..f62193e 100644 --- a/anne-survey.rb +++ b/anne-survey.rb @@ -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?