diff options
author | Matthew Somerville <matthew@mysociety.org> | 2011-06-10 14:40:30 +0100 |
---|---|---|
committer | Matthew Somerville <matthew@mysociety.org> | 2011-06-10 14:40:30 +0100 |
commit | 40f13d3cc9dc903da5299901623677c205eff484 (patch) | |
tree | dc9ba86101496ef80ba9068cae83d7892e467dac /perllib/FixMyStreet/App/Controller/Report | |
parent | b02e8e5e29aa1b7087b08d6d7eddccae516b171a (diff) |
Consolidate MaPit calls to call out to it less.
Diffstat (limited to 'perllib/FixMyStreet/App/Controller/Report')
-rw-r--r-- | perllib/FixMyStreet/App/Controller/Report/New.pm | 7 |
1 files changed, 2 insertions, 5 deletions
diff --git a/perllib/FixMyStreet/App/Controller/Report/New.pm b/perllib/FixMyStreet/App/Controller/Report/New.pm index 46a90384c..375b36a51 100644 --- a/perllib/FixMyStreet/App/Controller/Report/New.pm +++ b/perllib/FixMyStreet/App/Controller/Report/New.pm @@ -341,6 +341,7 @@ could be found. sub determine_location : Private { my ( $self, $c ) = @_; + $c->stash->{fetch_all_areas} = 1; return 1 if # ( # @@ -618,11 +619,7 @@ sub process_report : Private { $report->name( Utils::trim_text( $params{name} ) ); $report->category( _ $params{category} ); - # FIXME: This is more inefficient than old FixMyStreet code, - # with 2 MaPit point calls per submission now rather than just one. - my $mapit_query = - sprintf( "4326/%s,%s", $report->longitude, $report->latitude ); - my $areas = mySociety::MaPit::call( 'point', $mapit_query ); + my $areas = $c->stash->{all_areas}; $report->areas( ',' . join( ',', sort keys %$areas ) . ',' ); # From earlier in the process. |