X-Git-Url: https://projects.mako.cc/source/selectricity-live/blobdiff_plain/b1b6fe468411fa18118846fef18c993167fdb570..c4072579c6b3e80d8f05768a9a68bc9ad7490b3c:/app/controllers/voter_controller.rb?ds=sidebyside 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)