diff --git a/src/lib/Hydra/Controller/Jobset.pm b/src/lib/Hydra/Controller/Jobset.pm index 3087f477..42accac0 100644 --- a/src/lib/Hydra/Controller/Jobset.pm +++ b/src/lib/Hydra/Controller/Jobset.pm @@ -47,6 +47,8 @@ sub jobset_GET { $c->stash->{totalShares} = getTotalShares($c->model('DB')->schema); + $c->stash->{emailNotification} = $c->config->{email_notification} // 0; + $self->status_ok($c, entity => $c->stash->{jobset}); } @@ -173,6 +175,7 @@ sub edit : Chained('jobsetChain') PathPart Args(0) { $c->stash->{edit} = !defined $c->stash->{params}->{cloneJobset}; $c->stash->{cloneJobset} = defined $c->stash->{params}->{cloneJobset}; $c->stash->{totalShares} = getTotalShares($c->model('DB')->schema); + $c->stash->{emailNotification} = $c->config->{email_notification} // 0; } diff --git a/src/lib/Hydra/Plugin/EmailNotification.pm b/src/lib/Hydra/Plugin/EmailNotification.pm index c7bc5d95..c2887631 100644 --- a/src/lib/Hydra/Plugin/EmailNotification.pm +++ b/src/lib/Hydra/Plugin/EmailNotification.pm @@ -44,6 +44,8 @@ EOF sub buildFinished { my ($self, $build, $dependents) = @_; + return unless $self->{config}->{email_notification} // 0; + die unless $build->finished; # Figure out to whom to send notification for each build. For diff --git a/src/root/edit-jobset.tt b/src/root/edit-jobset.tt index 30b9a4c9..6c380a3a 100644 --- a/src/root/edit-jobset.tt +++ b/src/root/edit-jobset.tt @@ -130,7 +130,7 @@