add settings page

This commit is contained in:
Kyle Drake 2013-07-06 23:56:41 -04:00
parent b0f3d40bda
commit 5eb85e28f3
5 changed files with 131 additions and 6 deletions

View file

@ -77,12 +77,13 @@ class Site < Sequel::Model
errors.add :over_capacity, 'We are currently at capacity, and cannot create your home page. We will fix this shortly. Please come back later and try again, our apologies.'
end
if new? && (values[:username].nil? || values[:username].empty? || values[:username].match(BAD_USERNAME_REGEX)) # || USERNAME_SHITLIST.include?(values[:username])
if values[:username].nil? || values[:username].empty? || values[:username].match(BAD_USERNAME_REGEX)
errors.add :username, 'A valid username is required.'
end
# Check for existing user
user = self.class.select(:id, :username).filter(username: values[:username]).first
if user