diff options
author | Struan Donald <struan@exo.org.uk> | 2011-05-26 15:52:49 +0100 |
---|---|---|
committer | Struan Donald <struan@exo.org.uk> | 2011-05-26 15:52:49 +0100 |
commit | f7a711c5b544d876928ba572f46912e09eff9b83 (patch) | |
tree | fff3fbc85b2d9271ea6b9de3a21a02e096802948 | |
parent | 8ab2f611d11503cc7fea779be7f7c2b314f91e74 (diff) |
consistency in how we set/check booleans from the database
-rwxr-xr-x | perllib/FixMyStreet/App/Controller/Questionnaire.pm | 2 | ||||
-rw-r--r-- | perllib/FixMyStreet/App/Controller/Report/Update.pm | 10 |
2 files changed, 6 insertions, 6 deletions
diff --git a/perllib/FixMyStreet/App/Controller/Questionnaire.pm b/perllib/FixMyStreet/App/Controller/Questionnaire.pm index f6d7299b3..1b1e5e547 100755 --- a/perllib/FixMyStreet/App/Controller/Questionnaire.pm +++ b/perllib/FixMyStreet/App/Controller/Questionnaire.pm @@ -90,7 +90,7 @@ sub submit_creator_fixed : Private { ); unless ( $questionnaire->in_storage ) { - $questionnaire->ever_reported( $c->stash->{reported} eq 'Yes' ? 'y' : 'n' ); + $questionnaire->ever_reported( $c->stash->{reported} eq 'Yes' ); $questionnaire->whensent( \'ms_current_timestamp()' ); $questionnaire->whenanswered( \'ms_current_timestamp()' ); $questionnaire->insert; diff --git a/perllib/FixMyStreet/App/Controller/Report/Update.pm b/perllib/FixMyStreet/App/Controller/Report/Update.pm index 8af3cd2a2..be0f8dc16 100644 --- a/perllib/FixMyStreet/App/Controller/Report/Update.pm +++ b/perllib/FixMyStreet/App/Controller/Report/Update.pm @@ -51,11 +51,11 @@ sub update_problem : Private { my $update = $c->stash->{update}; my $problem = $c->stash->{problem} || $update->problem; - if ( $update->mark_fixed eq 't' ) { + if ( $update->mark_fixed ) { $problem->state('fixed'); if ( $update->user->id == $problem->user->id ) { - $problem->send_questionnaire('f'); + $problem->send_questionnaire(0); if ( $c->cobrand->ask_ever_reported && !$problem->user->answered_ever_reported ) @@ -157,9 +157,9 @@ sub process_update : Private { my $name = Utils::trim_text( $params{name} ); - my $anonymous = 't'; + my $anonymous = 1; - $anonymous = 'f' if ( $name && $c->req->param('may_show_name') ); + $anonymous = 0 if ( $name && $c->req->param('may_show_name') ); my $update = $c->model('DB::Comment')->new( { @@ -168,7 +168,7 @@ sub process_update : Private { problem => $c->stash->{problem}, user => $c->stash->{update_user}, state => 'unconfirmed', - mark_fixed => $params{fixed} ? 't' : 'f', + mark_fixed => $params{fixed} ? 1 : 0, cobrand => $c->cobrand->moniker, cobrand_data => $c->cobrand->extra_update_data, lang => $c->stash->{lang_code}, |