From 48678df8b67d562f16a88dbbc2e3878e53635932 Mon Sep 17 00:00:00 2001 From: Bas van Dijk Date: Thu, 9 Jul 2020 01:08:11 +0200 Subject: [PATCH] updateDeclarativeJobset: only set the emailresponsible column when defined (#788) --- src/lib/Hydra/Helper/AddBuilds.pm | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/src/lib/Hydra/Helper/AddBuilds.pm b/src/lib/Hydra/Helper/AddBuilds.pm index 4257c2ab..7a6fcef9 100644 --- a/src/lib/Hydra/Helper/AddBuilds.pm +++ b/src/lib/Hydra/Helper/AddBuilds.pm @@ -52,11 +52,12 @@ sub updateDeclarativeJobset { my $jobset = $project->jobsets->update_or_create(\%update); $jobset->jobsetinputs->delete; while ((my $name, my $data) = each %{$declSpec->{"inputs"}}) { - my $input = $jobset->jobsetinputs->create( - { name => $name, - type => $data->{type}, - emailresponsible => $data->{emailresponsible} - }); + my $row = { + name => $name, + type => $data->{type} + }; + $row->{emailresponsible} = $data->{emailresponsible} if defined $data->{emailresponsible}; + my $input = $jobset->jobsetinputs->create($row); $input->jobsetinputalts->create({altnr => 0, value => $data->{value}}); } delete $declSpec->{"inputs"};