diff options
Diffstat (limited to 'perllib/FixMyStreet/App/Controller/Report/New.pm')
-rw-r--r-- | perllib/FixMyStreet/App/Controller/Report/New.pm | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/perllib/FixMyStreet/App/Controller/Report/New.pm b/perllib/FixMyStreet/App/Controller/Report/New.pm index 8d249b899..af4cdd5aa 100644 --- a/perllib/FixMyStreet/App/Controller/Report/New.pm +++ b/perllib/FixMyStreet/App/Controller/Report/New.pm @@ -109,9 +109,14 @@ sub report_form_ajax : Path('ajax') : Args(0) { $c->forward('initialize_report'); # work out the location for this report and do some checks - # XXX We don't want to do this here if this actually happens! - return $c->forward('redirect_to_around') - unless $c->forward('determine_location'); + if ( ! $c->forward('determine_location') ) { + my $body = JSON->new->utf8(1)->encode( { + error => $c->stash->{location_error}, + } ); + $c->res->content_type('application/json; charset=utf-8'); + $c->res->body($body); + return; + } $c->forward('setup_categories_and_councils'); |