TT#35429 Fix using boolean json strings in /api/admins

Change-Id: If60ef0e75042c23771294315bd62513ee6d7678d
(cherry picked from commit 17d36cc339)
changes/45/21145/4
Irina Peshinskaya 7 years ago
parent 0440e0d241
commit 6771d420c4

@ -80,8 +80,7 @@ sub process_form_resource{
$resource->{saltedpass} = NGCP::Panel::Utils::Admin::generate_salted_hash($pass);
}
foreach my $f(qw/billing_data call_data is_active is_master is_superuser lawful_intercept read_only show_passwords/) {
$resource->{$f} = (ref $resource->{$f} eq 'JSON::true' ) ? 1 : 0;
#|| $resource->{$f} eq 'true'
$resource->{$f} = (ref $resource->{$f} eq 'JSON::true' || $resource->{$f} eq 'true') ? 1 : 0;
}
return $resource;
}

Loading…
Cancel
Save