Merge pull request #604 from andir/single-build-restart
allow users with 'restart-jobs' role to restart individual builds
This commit is contained in:
commit
adf59a3959
|
@ -493,7 +493,7 @@ sub nix : Chained('buildChain') PathPart('nix') CaptureArgs(0) {
|
||||||
sub restart : Chained('buildChain') PathPart Args(0) {
|
sub restart : Chained('buildChain') PathPart Args(0) {
|
||||||
my ($self, $c) = @_;
|
my ($self, $c) = @_;
|
||||||
my $build = $c->stash->{build};
|
my $build = $c->stash->{build};
|
||||||
requireProjectOwner($c, $build->project);
|
requireRestartPrivileges($c, $build->project);
|
||||||
my $n = restartBuilds($c->model('DB')->schema, $c->model('DB::Builds')->search({ id => $build->id }));
|
my $n = restartBuilds($c->model('DB')->schema, $c->model('DB::Builds')->search({ id => $build->id }));
|
||||||
error($c, "This build cannot be restarted.") if $n != 1;
|
error($c, "This build cannot be restarted.") if $n != 1;
|
||||||
$c->flash->{successMsg} = "Build has been restarted.";
|
$c->flash->{successMsg} = "Build has been restarted.";
|
||||||
|
|
Loading…
Reference in a new issue