Make jobset deletion consistent with project deletion
This commit is contained in:
@ -131,6 +131,11 @@ sub submit : Chained('jobset') PathPart Args(0) {
|
||||
requireProjectOwner($c, $c->stash->{project});
|
||||
requirePost($c);
|
||||
|
||||
if (($c->request->params->{submit} // "") eq "delete") {
|
||||
$c->stash->{jobset}->delete;
|
||||
return $c->res->redirect($c->uri_for($c->controller('Project')->action_for("view"), [$c->stash->{project}->name]));
|
||||
}
|
||||
|
||||
txn_do($c->model('DB')->schema, sub {
|
||||
updateJobset($c, $c->stash->{jobset});
|
||||
});
|
||||
@ -140,21 +145,6 @@ sub submit : Chained('jobset') PathPart Args(0) {
|
||||
}
|
||||
|
||||
|
||||
sub delete : Chained('jobset') PathPart Args(0) {
|
||||
my ($self, $c) = @_;
|
||||
|
||||
requireProjectOwner($c, $c->stash->{project});
|
||||
requirePost($c);
|
||||
|
||||
txn_do($c->model('DB')->schema, sub {
|
||||
$c->stash->{jobset}->delete;
|
||||
});
|
||||
|
||||
$c->res->redirect($c->uri_for($c->controller('Project')->action_for("view"),
|
||||
[$c->stash->{project}->name]));
|
||||
}
|
||||
|
||||
|
||||
sub nixExprPathFromParams {
|
||||
my ($c) = @_;
|
||||
|
||||
|
@ -45,9 +45,9 @@ sub submit : Chained('project') PathPart Args(0) {
|
||||
requireProjectOwner($c, $c->stash->{project});
|
||||
requirePost($c);
|
||||
|
||||
if (($c->request->params->{submit} || "") eq "delete") {
|
||||
if (($c->request->params->{submit} // "") eq "delete") {
|
||||
$c->stash->{project}->delete;
|
||||
$c->res->redirect($c->uri_for("/"));
|
||||
return $c->res->redirect($c->uri_for("/"));
|
||||
}
|
||||
|
||||
txn_do($c->model('DB')->schema, sub {
|
||||
|
Reference in New Issue
Block a user