]> projects.mako.cc - selectricity-live/blobdiff - app/controllers/quickvote_controller.rb
fix bug that allowed votes with more rankings than candidates to be recorded
[selectricity-live] / app / controllers / quickvote_controller.rb
index b57abaa40dfba69ab01d3912023e183bda8af771..cd16743fcc16e2095f46b1eff115c47f2cd51d39 100644 (file)
@@ -165,10 +165,12 @@ class QuickvoteController < ApplicationController
       @voter.save
       
       # toggle the confirmation bit      
-      @voter.vote.confirm!
-     
-      @voter.reload
-      render :action => 'thanks'
+      if @voter.vote.confirm!
+        @voter.reload
+        render :action => 'thanks'
+      else
+        redirect_to :action => 'index'
+      end
     end
   end
  

Benjamin Mako Hill || Want to submit a patch?