diff --git a/src/lib/Hydra/Controller/Job.pm b/src/lib/Hydra/Controller/Job.pm
index fc37972d..66a12e5f 100644
--- a/src/lib/Hydra/Controller/Job.pm
+++ b/src/lib/Hydra/Controller/Job.pm
@@ -31,11 +31,7 @@ sub overview : Chained('job') PathPart('') Args(0) {
$c->stash->{queuedBuilds} = [
$job->builds->search(
{ finished => 0 },
- { join => ['project']
- , order_by => ["priority DESC", "id"]
- , '+select' => ['project.enabled']
- , '+as' => ['enabled']
- }
+ { order_by => ["priority DESC", "id"] }
) ];
# If this is an aggregate job, then get its constituents.
diff --git a/src/lib/Hydra/Controller/Jobset.pm b/src/lib/Hydra/Controller/Jobset.pm
index b8a149d2..a7c88c2a 100644
--- a/src/lib/Hydra/Controller/Jobset.pm
+++ b/src/lib/Hydra/Controller/Jobset.pm
@@ -197,14 +197,15 @@ sub updateJobset {
my ($nixExprPath, $nixExprInput) = nixExprPathFromParams $c;
- my $enabled = defined $c->stash->{params}->{enabled};
+ my $enabled = int($c->stash->{params}->{enabled});
+ die if $enabled < 0 || $enabled > 2;
$jobset->update(
{ name => $jobsetName
, description => trim($c->stash->{params}->{"description"})
, nixexprpath => $nixExprPath
, nixexprinput => $nixExprInput
- , enabled => $enabled ? 1 : 0
+ , enabled => $enabled
, enableemail => defined $c->stash->{params}->{enableemail} ? 1 : 0
, emailoverride => trim($c->stash->{params}->{emailoverride}) || ""
, hidden => defined $c->stash->{params}->{visible} ? 0 : 1
diff --git a/src/lib/Hydra/Controller/Root.pm b/src/lib/Hydra/Controller/Root.pm
index 6a2d3619..281cc90c 100644
--- a/src/lib/Hydra/Controller/Root.pm
+++ b/src/lib/Hydra/Controller/Root.pm
@@ -74,7 +74,7 @@ sub queue_GET {
$self->status_ok(
$c,
entity => [$c->model('DB::Builds')->search(
- {finished => 0}, { join => ['project'], order_by => ["priority DESC", "id"], columns => [@buildListColumns], '+select' => ['project.enabled'], '+as' => ['enabled'] })]
+ {finished => 0}, { order_by => ["priority DESC", "id"], columns => [@buildListColumns] })]
);
}
diff --git a/src/lib/Hydra/Helper/Nix.pm b/src/lib/Hydra/Helper/Nix.pm
index 3b6afbf9..fe506750 100644
--- a/src/lib/Hydra/Helper/Nix.pm
+++ b/src/lib/Hydra/Helper/Nix.pm
@@ -540,7 +540,7 @@ sub grab {
sub getTotalShares {
my ($db) = @_;
return $db->resultset('Jobsets')->search(
- { 'project.enabled' => 1, 'me.enabled' => 1 },
+ { 'project.enabled' => 1, 'me.enabled' => { '!=' => 0 } },
{ join => 'project', select => { sum => 'schedulingshares' }, as => 'sum' })->single->get_column('sum');
}
diff --git a/src/root/edit-jobset.tt b/src/root/edit-jobset.tt
index c299f60f..8c2e9b87 100644
--- a/src/root/edit-jobset.tt
+++ b/src/root/edit-jobset.tt
@@ -49,11 +49,18 @@