X-Git-Url: https://projects.mako.cc/source/selectricity/blobdiff_plain/99e1580f0d7707b8e2f8c08f8aae70c3d4906637..3062c2d0a2b51fdf3c6b1f3bbd35d524020890a7:/app/controllers/voter_controller.rb?ds=sidebyside diff --git a/app/controllers/voter_controller.rb b/app/controllers/voter_controller.rb index 408bdab..a550f67 100644 --- a/app/controllers/voter_controller.rb +++ b/app/controllers/voter_controller.rb @@ -97,16 +97,18 @@ class VoterController < ApplicationController end def confirm - @voter.vote.confirm! - - if @voter.election.embeddable? and params[:embed] == "true" \ - and @voter.election.early_results? - redirect_to :action => :results, :id => @password, :embed => 'true' - elsif not(@voter.election.verifiable) \ - and @voter.election.kiosk and params[:kiosk] == "true" - redirect_to :action => "kiosk_ready", :id => @password, :kiosk => true + if @voter.vote.confirm! + if @voter.election.embeddable? and params[:embed] == "true" \ + and @voter.election.early_results? + redirect_to :action => :results, :id => @password, :embed => 'true' + elsif not(@voter.election.verifiable) \ + and @voter.election.kiosk and params[:kiosk] == "true" + redirect_to :action => "kiosk_ready", :id => @password, :kiosk => true + else + render :action => 'thanks' + end else - render :action => 'thanks' + redirect_to :action => 'index' end end