summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--libpiny/lib/Piny/User.pm2
1 files changed, 1 insertions, 1 deletions
diff --git a/libpiny/lib/Piny/User.pm b/libpiny/lib/Piny/User.pm
index 20ef4f1..6267ecb 100644
--- a/libpiny/lib/Piny/User.pm
+++ b/libpiny/lib/Piny/User.pm
@@ -18,7 +18,7 @@ use Piny::Group;
subtype 'Username'
=> as 'Str'
=> where { $_ =~ /^(?!(git|ikiwiki)-)[a-zA-Z][a-zA-Z0-9_.-]*$/ }
- => message { 'That username is not in the correct format for a piny user.' }
+ => message { if ( /^((?:git|ikiwiki)-|[^a-zA-Z])/ ) { "Usernames are not allowed to begin with $1" } elsif ( /([^a-zA-Z0-9_.-])/ ) { "Usernames are not allowed to contain $1" } else { "Invalid username" } }
;
# Attributes