]> projects.mako.cc - selectricity/blobdiff - app/controllers/quickvote_controller.rb
fix security issue
[selectricity] / 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?