]> projects.mako.cc - selectricity/blobdiff - app/controllers/voter_controller.rb
Suppress description of voter-verifiability unless election is verifiable.
[selectricity] / app / controllers / voter_controller.rb
index 408bdab880ec0f411a1d19f8eea0261f3b5d1d02..a550f676cc3d2ced5c851eef5c4f4c8632363159 100644 (file)
@@ -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
   

Benjamin Mako Hill || Want to submit a patch?