]> projects.mako.cc - selectricity/blobdiff - app/models/token.rb
Added a link to open elections off the election's 'show' page
[selectricity] / app / models / token.rb
index aa432d659de0ca723569c22e2a9fab3e7a167310..c2d3667a9027a5a29da5628e04b9c73c0a6426d8 100644 (file)
@@ -23,7 +23,7 @@ class Token < ActiveRecord::Base
     super
 
     token_generator = UniqueTokenGenerator.new( 16 )
-    until not token.empty? and Token.find(:all, :conditions => [ "token = ?", token ]).empty?
+    until not token.empty? and Token.find(:all, :conditions => [ "token = ?", token ]).empty? and token[0..3] != "open"
       self.token = token_generator.token
     end
 

Benjamin Mako Hill || Want to submit a patch?