mirror of
https://github.com/neocities/neocities.git
synced 2025-05-19 02:39:35 +02:00
implement new signup form validation
This commit is contained in:
parent
1aac62923d
commit
42e2935916
6 changed files with 100 additions and 28 deletions
|
@ -643,7 +643,7 @@ class Site < Sequel::Model
|
|||
super
|
||||
|
||||
if !self.class.valid_username?(values[:username])
|
||||
errors.add :username, 'A valid user/site name is required.'
|
||||
errors.add :username, 'Usernames can only contain letters, numbers, underscores and hyphens.'
|
||||
end
|
||||
|
||||
if new? && !values[:username].nil? && !values[:username].empty?
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue