From 05c7989c3ebe9e36ef59cd97d069481744413f30 Mon Sep 17 00:00:00 2001 From: Eelco Dolstra Date: Fri, 2 Oct 2009 17:11:28 +0000 Subject: [PATCH] * Don't show platforms that are not included in the current jobset. --- src/lib/Hydra/Base/Controller/ListBuilds.pm | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/lib/Hydra/Base/Controller/ListBuilds.pm b/src/lib/Hydra/Base/Controller/ListBuilds.pm index 7cbffae1..e0d12122 100644 --- a/src/lib/Hydra/Base/Controller/ListBuilds.pm +++ b/src/lib/Hydra/Base/Controller/ListBuilds.pm @@ -109,12 +109,11 @@ sub latest : Chained('get_builds') PathPart('latest') { my ($self, $c, @rest) = @_; my ($latest) = joinWithResultInfo($c, $c->stash->{allBuilds}) - ->search({finished => 1, buildstatus => 0}, {order_by => ["timestamp DESC"]}); + ->search({finished => 1, buildstatus => 0}, {order_by => ["isCurrent DESC", "timestamp DESC"]}); notFound($c, "There is no successful build to redirect to.") unless defined $latest; $c->res->redirect($c->uri_for($c->controller('Build')->action_for("view_build"), [$latest->id], @rest)); - } @@ -125,7 +124,7 @@ sub latest_for : Chained('get_builds') PathPart('latest-for') { notFound($c, "You need to specify a platform type in the URL.") unless defined $system; my ($latest) = joinWithResultInfo($c, $c->stash->{allBuilds}) - ->search({finished => 1, buildstatus => 0, system => $system}, {order_by => ["timestamp DESC"]}); + ->search({finished => 1, buildstatus => 0, system => $system}, {order_by => ["isCurrent DESC", "timestamp DESC"]}); notFound($c, "There is no successful build for platform `$system' to redirect to.") unless defined $latest;