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