initial browsing page

This commit is contained in:
Kyle Drake 2013-06-20 14:56:04 -07:00
parent b057ecc7a1
commit d0a359283e
4 changed files with 21 additions and 8 deletions

View file

@ -73,9 +73,12 @@ class Site < Sequel::Model
end
# Check for existing user
user = self.class.select(:username).filter(username: values[:username]).first
if !user.nil? && (user.id != values[:id])
errors.add :username, 'This username is already taken. Try using another one.'
if new?
user = self.class.select(:username).filter(username: values[:username]).first
if !user.nil? && (user.id != values[:id])
errors.add :username, 'This username is already taken. Try using another one.'
end
end
if values[:password].nil? || (@password_length && @password_length < MINIMUM_PASSWORD_LENGTH)