X-Git-Url: https://projects.mako.cc/source/selectricity-live/blobdiff_plain/99e1580f0d7707b8e2f8c08f8aae70c3d4906637..5c62b1606f7f89efdd5a6c51308cd0212fe9a709:/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