* Allow omitting the product number if there is only one product in a
build. This allows URLs like http://server/job/patchelf/trunk/deb_debian40i386/latest/download or http://server/release/patchelf/unstable/latest/deb_debian40i386/download
This commit is contained in:
@ -102,8 +102,10 @@ sub defaultUriForProduct {
|
||||
sub download : Chained('build') PathPart {
|
||||
my ($self, $c, $productnr, @path) = @_;
|
||||
|
||||
$productnr = 1 if !defined $productnr;
|
||||
|
||||
my $product = $c->stash->{build}->buildproducts->find({productnr => $productnr});
|
||||
notFound($c, "Build doesn't have a product $productnr.") if !defined $product;
|
||||
notFound($c, "Build doesn't have a product #$productnr.") if !defined $product;
|
||||
|
||||
notFound($c, "Product " . $product->path . " has disappeared.") unless -e $product->path;
|
||||
|
||||
|
Reference in New Issue
Block a user