forked from lix-project/hydra
Fix project/jobset deletion
This commit is contained in:
parent
40debf1515
commit
1c30a777ad
|
@ -132,7 +132,11 @@ sub submit : Chained('jobset') PathPart Args(0) {
|
|||
requirePost($c);
|
||||
|
||||
if (($c->request->params->{submit} // "") eq "delete") {
|
||||
$c->stash->{jobset}->delete;
|
||||
txn_do($c->model('DB')->schema, sub {
|
||||
$c->stash->{jobset}->jobsetevals->delete_all;
|
||||
$c->stash->{jobset}->builds->delete_all;
|
||||
$c->stash->{jobset}->delete;
|
||||
});
|
||||
return $c->res->redirect($c->uri_for($c->controller('Project')->action_for("view"), [$c->stash->{project}->name]));
|
||||
}
|
||||
|
||||
|
|
|
@ -46,7 +46,11 @@ sub submit : Chained('project') PathPart Args(0) {
|
|||
requirePost($c);
|
||||
|
||||
if (($c->request->params->{submit} // "") eq "delete") {
|
||||
$c->stash->{project}->delete;
|
||||
txn_do($c->model('DB')->schema, sub {
|
||||
$c->stash->{project}->jobsetevals->delete_all;
|
||||
$c->stash->{project}->builds->delete_all;
|
||||
$c->stash->{project}->delete;
|
||||
});
|
||||
return $c->res->redirect($c->uri_for("/"));
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue