X-Git-Url: https://projects.mako.cc/source/selectricity/blobdiff_plain/b1b6fe468411fa18118846fef18c993167fdb570..19a1975ef6170d77997da210512b370cc883af64:/app/controllers/voter_controller.rb diff --git a/app/controllers/voter_controller.rb b/app/controllers/voter_controller.rb index afc0103..78f9a0c 100644 --- a/app/controllers/voter_controller.rb +++ b/app/controllers/voter_controller.rb @@ -128,16 +128,18 @@ class VoterController < ApplicationController def confirm if authenticate - @voter.vote.confirm! - - if @voter.election.embeddable? and params[:embed] == "true" \ - and @voter.election.early_results? - redirect_to :action => :results, :id => @password, :embed => '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' + else + render :action => 'thanks' + end else - render :action => 'thanks' + redirect_to :action => 'index' end else - redirect_to :action => 'index' + redirect_to :action => 'index' end end @@ -153,7 +155,6 @@ class VoterController < ApplicationController end def results - debugger if authenticate and (@voter.election.early_results? \ or @voter.election.enddate < Time.now)