From af1e60a043009453cb775e472ad0137b6eefc31d Mon Sep 17 00:00:00 2001 From: Eelco Dolstra Date: Thu, 19 Mar 2009 15:12:50 +0000 Subject: [PATCH] * Allow `-' in project/jobset names. --- src/lib/Hydra/Controller/Project.pm | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/lib/Hydra/Controller/Project.pm b/src/lib/Hydra/Controller/Project.pm index d2f7ec42..74fea6e9 100644 --- a/src/lib/Hydra/Controller/Project.pm +++ b/src/lib/Hydra/Controller/Project.pm @@ -100,7 +100,7 @@ sub create_submit : Path('/create-project/submit') { sub updateProject { my ($c, $project) = @_; my $projectName = trim $c->request->params->{name}; - error($c, "Invalid project name: " . ($projectName || "(empty)")) unless $projectName =~ /^[[:alpha:]]\w*$/; + error($c, "Invalid project name: " . ($projectName || "(empty)")) unless $projectName =~ /^[[:alpha:]][\w\-]*$/; my $displayName = trim $c->request->params->{displayname}; error($c, "Invalid display name: $displayName") if $displayName eq ""; @@ -128,7 +128,7 @@ sub updateProject { next if $baseName eq "template"; my $jobsetName = trim $c->request->params->{"jobset-$baseName-name"}; - error($c, "Invalid jobset name: $jobsetName") unless $jobsetName =~ /^[[:alpha:]]\w*$/; + error($c, "Invalid jobset name: $jobsetName") unless $jobsetName =~ /^[[:alpha:]][\w\-]*$/; # The Nix expression path must be relative and can't contain ".." elements. my $nixExprPath = trim $c->request->params->{"jobset-$baseName-nixexprpath"};