diff options
author | Matthew Somerville <matthew@mysociety.org> | 2013-02-20 15:56:53 +0000 |
---|---|---|
committer | Matthew Somerville <matthew@mysociety.org> | 2013-02-20 16:38:58 +0000 |
commit | 9ce6e383640811b9b51ffe7a46c1b5dfac66e14c (patch) | |
tree | 784164cfa8af0ebbb16c6e75bf571dadaf36368d /perllib/FixMyStreet/App/Controller/Around.pm | |
parent | 577e26282626ef640aa75dbc02e727a3977a1784 (diff) |
Redirect to front page if nothing provided.
Diffstat (limited to 'perllib/FixMyStreet/App/Controller/Around.pm')
-rw-r--r-- | perllib/FixMyStreet/App/Controller/Around.pm | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/perllib/FixMyStreet/App/Controller/Around.pm b/perllib/FixMyStreet/App/Controller/Around.pm index 9a754f063..492565bb9 100644 --- a/perllib/FixMyStreet/App/Controller/Around.pm +++ b/perllib/FixMyStreet/App/Controller/Around.pm @@ -40,9 +40,10 @@ sub around_index : Path : Args(0) { my $partial_report = $c->forward('load_partial'); # Try to create a location for whatever we have - return - unless $c->forward('/location/determine_location_from_coords') - || $c->forward('/location/determine_location_from_pc'); + my $ret = $c->forward('/location/determine_location_from_coords') + || $c->forward('/location/determine_location_from_pc'); + return unless $ret; + return $c->res->redirect('/') if $ret == -1; # Check to see if the spot is covered by a area - if not show an error. return unless $c->cobrand->moniker eq 'fixmybarangay' || $c->forward('check_location_is_acceptable'); |