mirror of
https://github.com/hkalexling/Mango.git
synced 2025-08-03 03:15:31 -04:00
Allow hyphens in username (#99)
This commit is contained in:
parent
220fc42bf2
commit
a68f3eea95
@ -2,9 +2,9 @@ def validate_username(username)
|
|||||||
if username.size < 3
|
if username.size < 3
|
||||||
raise "Username should contain at least 3 characters"
|
raise "Username should contain at least 3 characters"
|
||||||
end
|
end
|
||||||
if (username =~ /^[A-Za-z0-9_]+$/).nil?
|
if (username =~ /^[a-zA-Z_][a-zA-Z0-9_\-]*$/).nil?
|
||||||
raise "Username should contain alphanumeric characters " \
|
raise "Username can only contain alphanumeric characters, " \
|
||||||
"and underscores only"
|
"underscores, and hyphens"
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user