Streamlined some graphign contorller methods and took out the 'voters_per_day' method...
[selectricity] / app / controllers / quickvote_controller.rb
index 58370f7096b8b3b2ba1e0057553087ca2cc3e378..5b3acab79f21998d5897e90cc331b71745c37b8c 100644 (file)
@@ -21,7 +21,6 @@ class QuickvoteController < ApplicationController
         @quickvote = @quickvote.reload
         render :action => 'success'
       else
-        raise ArgumentError.new(@quickvote.errors.inspect)
         flash.keep(:candlist)
       end 
 
@@ -157,7 +156,11 @@ class QuickvoteController < ApplicationController
   ###############################################################
 
   def results
-    @election = QuickVote.ident_to_quickvote(params[:ident])
+    unless @election = QuickVote.ident_to_quickvote(params[:ident])
+      flash[:notice] = "Cannot find quickvote #{params[:ident]}."
+      redirect_to :controller => 'site'
+      return
+    end
     @election.results
     @candidates = {}
     @election.candidates.each {|c| @candidates[c.id] = c}

Benjamin Mako Hill || Want to submit a patch?