Allow dashes in jobset input names
Signed-off-by: Shea Levy <shea@shealevy.com>
This commit is contained in:
@ -248,7 +248,7 @@ sub nixExprPathFromParams {
|
||||
error($c, "Invalid Nix expression path: $nixExprPath") if $nixExprPath !~ /^$relPathRE$/;
|
||||
|
||||
my $nixExprInput = trim $c->stash->{params}->{"nixexprinput"};
|
||||
error($c, "Invalid Nix expression input name: $nixExprInput") unless $nixExprInput =~ /^\w+$/;
|
||||
error($c, "Invalid Nix expression input name: $nixExprInput") unless $nixExprInput =~ /^[[:alpha:]][\w-]*$/;
|
||||
|
||||
return ($nixExprPath, $nixExprInput);
|
||||
}
|
||||
@ -309,7 +309,7 @@ sub updateJobset {
|
||||
|
||||
foreach my $inputName (keys %{$c->stash->{params}->{inputs}}) {
|
||||
my $inputData = $c->stash->{params}->{inputs}->{$inputName};
|
||||
error($c, "Invalid input name: $inputName") unless $inputName =~ /^[[:alpha:]]\w*$/;
|
||||
error($c, "Invalid input name: $inputName") unless $inputName =~ /^[[:alpha:]][\w-]*$/;
|
||||
|
||||
my $inputType = $inputData->{type};
|
||||
|
||||
|
@ -223,7 +223,7 @@ sub end : ActionClass('RenderView') {
|
||||
}
|
||||
|
||||
if (scalar @{$c->error}) {
|
||||
$c->stash->{resource} = { errors => "$c->error" };
|
||||
$c->stash->{resource} = { errors => $c->error };
|
||||
$c->stash->{template} = 'error.tt';
|
||||
$c->stash->{errors} = $c->error;
|
||||
$c->response->status(500) if $c->response->status == 200;
|
||||
|
Reference in New Issue
Block a user