diff options
author | Matthew Somerville <matthew@mysociety.org> | 2012-12-14 12:11:13 +0000 |
---|---|---|
committer | Matthew Somerville <matthew@mysociety.org> | 2012-12-15 00:11:06 +0000 |
commit | ff06783c6dc50321100a54b4d4a624fde2212689 (patch) | |
tree | 38d7f914f841a6ba8ea3225bae3cacbabc80dbf9 /perllib/FixMyStreet/App/Controller | |
parent | bb356c880412db8bad655e081ad6d68f25ae3ff7 (diff) |
Make from_body a foreign key.
Diffstat (limited to 'perllib/FixMyStreet/App/Controller')
-rw-r--r-- | perllib/FixMyStreet/App/Controller/Admin.pm | 2 | ||||
-rw-r--r-- | perllib/FixMyStreet/App/Controller/Dashboard.pm | 10 |
2 files changed, 6 insertions, 6 deletions
diff --git a/perllib/FixMyStreet/App/Controller/Admin.pm b/perllib/FixMyStreet/App/Controller/Admin.pm index d64ca4862..56789b81c 100644 --- a/perllib/FixMyStreet/App/Controller/Admin.pm +++ b/perllib/FixMyStreet/App/Controller/Admin.pm @@ -827,7 +827,7 @@ sub user_edit : Path('user_edit') : Args(1) { if ( $user->email ne $c->req->param('email') || $user->name ne $c->req->param('name' ) || - $user->from_body != $c->req->param('body') ) { + $user->from_body->id != $c->req->param('body') ) { $edited = 1; } diff --git a/perllib/FixMyStreet/App/Controller/Dashboard.pm b/perllib/FixMyStreet/App/Controller/Dashboard.pm index a355606f4..3a66cf1e0 100644 --- a/perllib/FixMyStreet/App/Controller/Dashboard.pm +++ b/perllib/FixMyStreet/App/Controller/Dashboard.pm @@ -88,19 +88,19 @@ Show the dashboard table. sub index : Path : Args(0) { my ( $self, $c ) = @_; - my $council = $c->forward('check_page_allowed'); + my $body = $c->forward('check_page_allowed'); # Set up the data for the dropdowns - my $council_detail = mySociety::MaPit::call('area', $council ); + my $council_detail = mySociety::MaPit::call('area', $body->area_id ); $c->stash->{council} = $council_detail; - my $children = mySociety::MaPit::call('area/children', $council, + my $children = mySociety::MaPit::call('area/children', $body->area_id, type => $c->cobrand->area_types_children, ); $c->stash->{children} = $children; - $c->stash->{all_areas} = { $council => $council_detail }; + $c->stash->{all_areas} = { $body->area_id => $council_detail }; $c->forward( '/report/new/setup_categories_and_bodies' ); # See if we've had anything from the dropdowns @@ -109,7 +109,7 @@ sub index : Path : Args(0) { $c->stash->{category} = $c->req->param('category'); my %where = ( - bodies_str => $council, # XXX This will break in a two tier council. Restriction needs looking at... + bodies_str => $body->id, # XXX Does this break in a two tier council? Restriction needs looking at... 'problem.state' => [ FixMyStreet::DB::Result::Problem->visible_states() ], ); $where{areas} = { 'like', '%,' . $c->stash->{ward} . ',%' } |