X-Git-Url: https://projects.mako.cc/source/selectricity-live/blobdiff_plain/6a935d078f20d2b1b0d60f0a30c41a642d40758a..de7ac9ab65e04dbb81165e4317894a0e160ac9be:/app/models/token.rb?ds=inline diff --git a/app/models/token.rb b/app/models/token.rb index aa432d6..8bfecc4 100644 --- a/app/models/token.rb +++ b/app/models/token.rb @@ -23,7 +23,8 @@ class Token < ActiveRecord::Base super token_generator = UniqueTokenGenerator.new( 16 ) - until not token.empty? and Token.find(:all, :conditions => [ "token = ?", token ]).empty? + until token and not token.empty? \ + and Token.find(:all, :conditions => [ "token = ?", token ]).empty? and token[0..3] != "open" self.token = token_generator.token end