diff options
author | Matthew Somerville <matthew@mysociety.org> | 2016-04-22 16:48:57 +0100 |
---|---|---|
committer | Matthew Somerville <matthew-github@dracos.co.uk> | 2016-05-18 12:57:52 +0100 |
commit | 1a1bfff12415a7793fee22bcd4e5e39e10dbd4d3 (patch) | |
tree | 6313f583e4e278ad3fb2885b8bd0493bd429b23c /perllib/FixMyStreet/App/Controller/Alert.pm | |
parent | 66d93ceaed9df6ff3e0e28a62e655ad769c99614 (diff) |
Fallback if request to Gaze fails.
Fixes #1286.
Diffstat (limited to 'perllib/FixMyStreet/App/Controller/Alert.pm')
-rw-r--r-- | perllib/FixMyStreet/App/Controller/Alert.pm | 7 |
1 files changed, 2 insertions, 5 deletions
diff --git a/perllib/FixMyStreet/App/Controller/Alert.pm b/perllib/FixMyStreet/App/Controller/Alert.pm index 6972bbc04..ddda02abd 100644 --- a/perllib/FixMyStreet/App/Controller/Alert.pm +++ b/perllib/FixMyStreet/App/Controller/Alert.pm @@ -5,6 +5,7 @@ use namespace::autoclean; BEGIN { extends 'Catalyst::Controller'; } use mySociety::EmailUtil qw(is_valid_email); +use FixMyStreet::Gaze; =head1 NAME @@ -441,11 +442,7 @@ sub determine_location : Private { $c->go('index'); } - my $dist = - mySociety::Gaze::get_radius_containing_population( $c->stash->{latitude}, - $c->stash->{longitude}, 200000 ); - $dist = int( $dist * 10 + 0.5 ); - $dist = $dist / 10.0; + my $dist = FixMyStreet::Gaze::get_radius_containing_population($c->stash->{latitude}, $c->stash->{longitude}); $c->stash->{population_radius} = $dist; return 1; |