Skip to content

Commit

Permalink
Move render_specific_not_found to SharedHelpers
Browse files Browse the repository at this point in the history
Issues:
* https://progress.opensuse.org/issues/163931
* https://progress.opensuse.org/issues/163592
* https://progress.opensuse.org/issues/163757

Prevents:

    Can't locate object method "render_specific_not_found" via package "OpenQA::Shared::Controller::Running"
  • Loading branch information
perlpunk committed Jul 15, 2024
1 parent 4ad2e08 commit bfb84ef
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 14 deletions.
14 changes: 14 additions & 0 deletions lib/OpenQA/Shared/Plugin/SharedHelpers.pm
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ sub register ($self, $app, @) {
$app->helper(is_operator => \&_is_operator);
$app->helper(is_admin => \&_is_admin);
$app->helper(is_local_request => \&_is_local_request);
$app->helper(render_specific_not_found => \&_render_specific_not_found);
}

# returns the isotovideo command server web socket URL and the VNC argument for the given job or undef if not available
Expand Down Expand Up @@ -73,4 +74,17 @@ sub _is_local_request ($c) {
return $address eq '127.0.0.1' || $address eq '::1';
}

sub _render_specific_not_found ($c) {
my ($c, $title, $error_message) = @_;

$c->stash(
title => $title,
error_message => $error_message,
);
return $c->render(
template => 'main/specific_not_found',
status => 404,
);
}

1;
14 changes: 0 additions & 14 deletions lib/OpenQA/WebAPI/Plugin/Helpers.pm
Original file line number Diff line number Diff line change
Expand Up @@ -286,20 +286,6 @@ sub register ($self, $app, $config) {
});
});

$app->helper(
render_specific_not_found => sub {
my ($c, $title, $error_message) = @_;

$c->stash(
title => $title,
error_message => $error_message,
);
return $c->render(
template => 'main/specific_not_found',
status => 404,
);
});

$app->helper(
populate_hash_with_needle_timestamps_and_urls => sub {
my ($c, $needle, $hash) = @_;
Expand Down

0 comments on commit bfb84ef

Please sign in to comment.