Disallow identical candidates to be added to a quickvote. Differently cased identical...
[selectricity-live] / app / controllers / quickvote_controller.rb
index 2847df91890d0ffd9212b1cee8c5281a9d1117f6..a365171e0a57bcd6abaaf746749ea404bd00b43f 100644 (file)
@@ -37,7 +37,7 @@ class QuickvoteController < ApplicationController
     candidate_name = CGI.escapeHTML(params[:ajax][:newcandidate])
     unless candidate_name.strip.empty?
       if flash.has_key?(:candlist) and flash[:candlist].instance_of?(Array) 
-        flash[:candlist] << candidate_name
+        flash[:candlist] << candidate_name unless flash[:candlist].index(candidate_name)
      else
        flash[:candlist] = [ candidate_name ]
       end

Benjamin Mako Hill || Want to submit a patch?