X-Git-Url: https://projects.mako.cc/source/selectricity/blobdiff_plain/2facf9c3cba1ddc270c84a713cafbe6eb7280efd..4446a6555bd54ca10a925340bb65c706678ac98e:/app/controllers/voter_controller.rb diff --git a/app/controllers/voter_controller.rb b/app/controllers/voter_controller.rb index afc0103..4ff8140 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