Skip to content

Commit

Permalink
Accept manually created snippets
Browse files Browse the repository at this point in the history
  • Loading branch information
kraih committed Aug 22, 2024
1 parent 018e0c7 commit e9551a4
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion lib/Cavil/Controller/Ignore.pm
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ sub add_glob ($self) {

sub add_match ($self) {
my $validation = $self->validation;
$validation->required('hash')->like(qr/^[a-f0-9]{32}$/i);
$validation->required('hash')->like(qr/^(?:[a-f0-9]{32}|manual-\w+)$/i);
$validation->required('package');
$validation->optional('delay')->num;
$validation->optional('contributor');
Expand Down
2 changes: 1 addition & 1 deletion lib/Cavil/Controller/Snippet.pm
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ sub edit ($self) {

sub from_file ($self) {
my $v = $self->validation;
$v->optional('hash')->like(qr/^[a-f0-9]{32}$/i);
$v->optional('hash')->like(qr/^(?:[a-f0-9]{32}|manual-\w+)$/i);
$v->optional('from');
return $self->reply->json_validation_error if $v->has_error;

Expand Down

0 comments on commit e9551a4

Please sign in to comment.