diff options
author | Matthew Somerville <matthew@mysociety.org> | 2019-10-03 14:47:31 +0100 |
---|---|---|
committer | Matthew Somerville <matthew@mysociety.org> | 2019-10-03 14:47:31 +0100 |
commit | 82d3721d01ac9c0399a8d0a4456d8972774f1eaf (patch) | |
tree | 801c605af227a3dedc1c216e80a4f211ec7b9f35 | |
parent | 83daf38ae088e79938950e36f1e5c1848877f175 (diff) |
Do not generate map data unless needed.
This saves e.g. a call to Gaze on successful report submission.
-rw-r--r-- | perllib/FixMyStreet/App/Controller/Report/New.pm | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/perllib/FixMyStreet/App/Controller/Report/New.pm b/perllib/FixMyStreet/App/Controller/Report/New.pm index 9b7a925b8..9c43eb227 100644 --- a/perllib/FixMyStreet/App/Controller/Report/New.pm +++ b/perllib/FixMyStreet/App/Controller/Report/New.pm @@ -102,19 +102,18 @@ sub report_new : Path : Args(0) { $c->stash->{template} = "report/new/fill_in_details.html"; $c->forward('setup_categories_and_bodies'); $c->forward('setup_report_extra_fields'); - $c->forward('generate_map'); $c->forward('check_for_category'); $c->forward('setup_report_extras'); # deal with the user and report and check both are happy - return unless $c->forward('check_form_submitted'); + $c->detach('generate_map') unless $c->forward('check_form_submitted'); $c->forward('/auth/check_csrf_token'); $c->forward('process_report'); $c->forward('process_user'); $c->forward('/photo/process_photo'); - return unless $c->forward('check_for_errors'); + $c->detach('generate_map') unless $c->forward('check_for_errors'); $c->forward('save_user_and_report'); $c->forward('redirect_or_confirm_creation'); } |