diff options
author | Marius Halden <marius.h@lden.org> | 2018-05-29 19:37:34 +0200 |
---|---|---|
committer | Marius Halden <marius.h@lden.org> | 2018-05-29 19:37:34 +0200 |
commit | 782457d016084c8de04989dbc824a71899f8b41b (patch) | |
tree | 56d14e1a988396e43c8693ff3486e40d16962add /perllib/FixMyStreet/App/Controller/Dashboard.pm | |
parent | 140d40e3eab4cb1e7aa9f95cbc24a0f13180b606 (diff) | |
parent | 6e2da95bc6a758c0cf070b9ddd51acc769f7acf1 (diff) |
Merge tag 'v2.3.1' into fiksgatami-dev
Diffstat (limited to 'perllib/FixMyStreet/App/Controller/Dashboard.pm')
-rw-r--r-- | perllib/FixMyStreet/App/Controller/Dashboard.pm | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/perllib/FixMyStreet/App/Controller/Dashboard.pm b/perllib/FixMyStreet/App/Controller/Dashboard.pm index 926e941f6..032c36e05 100644 --- a/perllib/FixMyStreet/App/Controller/Dashboard.pm +++ b/perllib/FixMyStreet/App/Controller/Dashboard.pm @@ -86,11 +86,7 @@ sub index : Path : Args(0) { if ($body) { $c->stash->{body_name} = $body->name; - my $area_id = $body->body_areas->first->area_id; - my $children = mySociety::MaPit::call('area/children', $area_id, - type => $c->cobrand->area_types_children, - ); - $c->stash->{children} = $children; + my $children = $c->stash->{children} = $body->first_area_children; $c->forward('/admin/fetch_contacts'); $c->stash->{contacts} = [ $c->stash->{contacts}->all ]; @@ -103,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'); |