diff options
-rw-r--r-- | CHANGELOG.md | 1 | ||||
-rw-r--r-- | perllib/FixMyStreet/App/Controller/Dashboard.pm | 3 | ||||
-rw-r--r-- | templates/web/base/dashboard/index.html | 1 |
3 files changed, 4 insertions, 1 deletions
diff --git a/CHANGELOG.md b/CHANGELOG.md index bfa76c784..f9b5fb971 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,7 @@ - Make sure dashboard filters all fit onto one line. - Fix issue with red bars on bar graph of many categories. - Prefetch translations in /reports list of bodies. + - Ignore deleted/area-less bodies in dashboard list. * v2.3 (18th December 2017) - New features: diff --git a/perllib/FixMyStreet/App/Controller/Dashboard.pm b/perllib/FixMyStreet/App/Controller/Dashboard.pm index 7a6e82093..032c36e05 100644 --- a/perllib/FixMyStreet/App/Controller/Dashboard.pm +++ b/perllib/FixMyStreet/App/Controller/Dashboard.pm @@ -99,7 +99,8 @@ sub index : Path : Args(0) { $c->stash->{body_name} = join "", map { $children->{$_}->{name} } grep { $children->{$_} } $c->user->area_id; } } else { - $c->forward('/admin/fetch_all_bodies'); + my @bodies = $c->model('DB::Body')->active->translated->with_area_count->all_sorted; + $c->stash->{bodies} = \@bodies; } $c->stash->{start_date} = $c->get_param('start_date'); diff --git a/templates/web/base/dashboard/index.html b/templates/web/base/dashboard/index.html index 23fd9bb42..cb6ca154f 100644 --- a/templates/web/base/dashboard/index.html +++ b/templates/web/base/dashboard/index.html @@ -50,6 +50,7 @@ <label for="ward">[% loc('Council:') %]</label> <select class="form-control" name="body" id="body"><option value=''>[% loc('All') %]</option> [% FOR b IN bodies %] + [% NEXT IF NOT b.get_column("area_count") %] <option value="[% b.id %]">[% b.name %]</option> [% END %] </select> |