updateDeclarativeJobset: only set the emailresponsible column when defined (#788)

This commit is contained in:
Bas van Dijk 2020-07-09 01:08:11 +02:00 committed by GitHub
parent 7985757a1d
commit 48678df8b6
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -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"};