mirror of
https://github.com/neocities/neocities.git
synced 2025-07-23 11:06:02 +02:00
Basic creation of initial site
This commit is contained in:
parent
0aaf894fa3
commit
5deb20e264
5 changed files with 54 additions and 3 deletions
|
@ -1,5 +1,6 @@
|
|||
class Site < Sequel::Model
|
||||
MINIMUM_PASSWORD_LENGTH = 5
|
||||
USERNAME_REGEX = /[^\w-]/i
|
||||
many_to_one :server
|
||||
many_to_many :tags
|
||||
|
||||
|
@ -59,7 +60,7 @@ 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 values[:username].nil? || values[:username].empty? || values[:username].match(/[^\w.-]/i)
|
||||
if values[:username].nil? || values[:username].empty? || values[:username].match(USERNAME_REGEX)
|
||||
errors.add :username, 'A valid username is required.'
|
||||
end
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue