diff options
author | Chris Mytton <self@hecticjeff.net> | 2013-11-07 17:49:36 +0000 |
---|---|---|
committer | Matthew Somerville <matthew@mysociety.org> | 2013-11-11 16:12:32 +0000 |
commit | 38e83cdcd305afdcb080f66226ddeb1660fa8f05 (patch) | |
tree | c2b169c5c0ad510f0d13e27f1bf962086bd8a4fd /perllib/FixMyStreet/App/Controller | |
parent | ab1625b7eaec127c727c236b98ba47a6643f4625 (diff) |
Don't display categories for deleted bodies
When a body has been marked as deleted (currently only exposed in the
Zurich cobrand's admin) the categories for that body should not be
available on the report_new form.
Prior to this change there was an error running the
'zurich-overdue-alert' script, because it wasn't expecting the
'bodies_str' field to have any entries in the format 'x|y,z', this
prevents this problem from happening in the future (though it doesn't
fix any existing entries with this issue).
Diffstat (limited to 'perllib/FixMyStreet/App/Controller')
-rw-r--r-- | perllib/FixMyStreet/App/Controller/Report/New.pm | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/perllib/FixMyStreet/App/Controller/Report/New.pm b/perllib/FixMyStreet/App/Controller/Report/New.pm index 59d38a6cf..7fe92bd70 100644 --- a/perllib/FixMyStreet/App/Controller/Report/New.pm +++ b/perllib/FixMyStreet/App/Controller/Report/New.pm @@ -585,7 +585,7 @@ sub setup_categories_and_bodies : Private { my $first_area = ( values %$all_areas )[0]; my @bodies = $c->model('DB::Body')->search( - { 'body_areas.area_id' => [ keys %$all_areas ] }, + { 'body_areas.area_id' => [ keys %$all_areas ], deleted => 0 }, { join => 'body_areas' } )->all; my %bodies = map { $_->id => $_ } @bodies; |