TT#149459 expand consider null fields as valid

* when field expand is requested and the field has "null" value
  (profile_id,profile_set_id), the field is considered as correct
  instead of returning 409 Conflict

Change-Id: I2dfa918a0b99bff75429baa3e94a734fcb8c17e2
mr10.2
Kirill Solomko 5 years ago
parent 2223ecf12e
commit 6a0b5d7a75

@ -1332,7 +1332,7 @@ sub expand_field {
$subfield = $2;
}
return unless $resource->{$field};
return unless exists $resource->{$field};
$found = 1;
my $expand_form = NGCP::Panel::Form::get("NGCP::Panel::Form::Expand", $c);
@ -1354,7 +1354,7 @@ sub expand_field {
return unless $expand->{allowed_roles};
return unless any { $c->user->roles eq $_ } @{$expand->{allowed_roles}};
my $id = $resource->{$field};
my $id = $resource->{$field} // return $found; # null value but the field exists
my $to = $expand->{to} // $field . '_expand';
my $class = $expand->{class} // return;
my $form = $class->get_form($c) // return;

Loading…
Cancel
Save