Skip to content
This repository has been archived by the owner on Nov 13, 2018. It is now read-only.

Commit

Permalink
Merge pull request #1605 from elsloo/1.6.x_backport_fix_broken_ds_upd…
Browse files Browse the repository at this point in the history
…ate_api

Fixes a bug that prevents cohesive usage of booleans and another bug …
  • Loading branch information
mitchell852 authored Jul 14, 2016
2 parents e41b3e4 + 0026201 commit 9d1ef9d
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions traffic_ops/app/lib/API/DeliveryService.pm
Original file line number Diff line number Diff line change
Expand Up @@ -582,9 +582,9 @@ sub check_params {
}

if ( defined($params->{active}) ) {
if ( $params->{active} eq "true" ) {
if ( $params->{active} eq "true" || $params->{active} == 1 ) {
$transformed_params->{active} = 1;
} elsif ( $params->{active} eq "false" ) {
} elsif ( $params->{active} eq "false" || $params->{active} == 0 ) {
$transformed_params->{active} = 0;
} else {
return (undef, "active must be true|false." );
Expand Down Expand Up @@ -675,9 +675,9 @@ sub check_params {
}

if ( defined($params->{logsEnabled}) ) {
if ( $params->{logsEnabled} eq "true" ) {
if ( $params->{logsEnabled} eq "true" || $params->{logsEnabled} == 1 ) {
$transformed_params->{logsEnabled} = 1;
} elsif ( $params->{logsEnabled} eq "false" ) {
} elsif ( $params->{logsEnabled} eq "false" || $params->{logsEnabled} == 0 ) {
$transformed_params->{logsEnabled} = 0;
} else {
return (undef, "logsEnabled must be true|false." );
Expand All @@ -697,7 +697,7 @@ sub new_value {
my $value = {
xml_id => $params->{xmlId},
display_name => $params->{displayName},
dscp => $self->nodef_to_default( $params->{dscp} eq "", 0 ),
dscp => $self->nodef_to_default( $params->{dscp}, 0 ),
signed => $self->nodef_to_default( $params->{signed}, 0 ),
qstring_ignore => $params->{qstringIgnore},
geo_limit => $params->{geoLimit},
Expand Down

0 comments on commit 9d1ef9d

Please sign in to comment.