only validate new records for username match

This commit is contained in:
Kyle Drake 2014-04-07 07:59:11 -04:00
parent db23061541
commit e56587a08c

View file

@ -192,7 +192,7 @@ class Site < Sequel::Model
end end
# TODO regex fails for usernames <= 2 chars, tempfix for now. # TODO regex fails for usernames <= 2 chars, tempfix for now.
if values[:username].length > 2 && !values[:username].match(VALID_HOSTNAME) if new? && values[:username].length > 2 && !values[:username].match(VALID_HOSTNAME)
errors.add :username, 'A valid user/site name is required.' errors.add :username, 'A valid user/site name is required.'
end end