forked from lix-project/hydra
Merge pull request #968 from DeterminateSystems/unnecessary-declarative-field
Projects: don't respond with unnecessary declarative field
This commit is contained in:
commit
5b6b8261fc
|
@ -263,15 +263,19 @@ sub as_json {
|
||||||
"enabled" => $self->get_column("enabled") ? JSON::true : JSON::false,
|
"enabled" => $self->get_column("enabled") ? JSON::true : JSON::false,
|
||||||
"hidden" => $self->get_column("hidden") ? JSON::true : JSON::false,
|
"hidden" => $self->get_column("hidden") ? JSON::true : JSON::false,
|
||||||
|
|
||||||
|
"jobsets" => [ map { $_->name } $self->jobsets ]
|
||||||
|
);
|
||||||
|
|
||||||
|
my %decl = (
|
||||||
"declarative" => {
|
"declarative" => {
|
||||||
"file" => $self->get_column("declfile") // "",
|
"file" => $self->get_column("declfile") // "",
|
||||||
"type" => $self->get_column("decltype") // "",
|
"type" => $self->get_column("decltype") // "",
|
||||||
"value" => $self->get_column("declvalue") // ""
|
"value" => $self->get_column("declvalue") // ""
|
||||||
},
|
}
|
||||||
|
|
||||||
"jobsets" => [ map { $_->name } $self->jobsets ]
|
|
||||||
);
|
);
|
||||||
|
|
||||||
|
%json = (%json, %decl) if !($decl{"declarative"}->{"file"} eq "");
|
||||||
|
|
||||||
return \%json;
|
return \%json;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -49,12 +49,7 @@ subtest "Read project 'tests'" => sub {
|
||||||
homepage => "",
|
homepage => "",
|
||||||
jobsets => [],
|
jobsets => [],
|
||||||
name => "tests",
|
name => "tests",
|
||||||
owner => "root",
|
owner => "root"
|
||||||
declarative => {
|
|
||||||
file => "",
|
|
||||||
type => "",
|
|
||||||
value => ""
|
|
||||||
}
|
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -136,12 +131,7 @@ subtest "Transitioning from declarative project to normal" => sub {
|
||||||
homepage => "",
|
homepage => "",
|
||||||
jobsets => [],
|
jobsets => [],
|
||||||
name => "tests",
|
name => "tests",
|
||||||
owner => "root",
|
owner => "root"
|
||||||
declarative => {
|
|
||||||
file => "",
|
|
||||||
type => "",
|
|
||||||
value => ""
|
|
||||||
}
|
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
Loading…
Reference in a new issue