From 020769f403ef4cf1880bd061b6db6b4f4028d3e4 Mon Sep 17 00:00:00 2001 From: Matthew Somerville Date: Thu, 1 Dec 2016 18:23:54 +0000 Subject: Return 400/500 for some client/server errors. --- perllib/FixMyStreet/App/Controller/Questionnaire.pm | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) (limited to 'perllib/FixMyStreet/App/Controller/Questionnaire.pm') diff --git a/perllib/FixMyStreet/App/Controller/Questionnaire.pm b/perllib/FixMyStreet/App/Controller/Questionnaire.pm index 017a552db..1b338732b 100755 --- a/perllib/FixMyStreet/App/Controller/Questionnaire.pm +++ b/perllib/FixMyStreet/App/Controller/Questionnaire.pm @@ -36,9 +36,8 @@ sub check_questionnaire : Private { if ( $questionnaire->whenanswered ) { my $problem_url = $c->cobrand->base_url_for_report( $problem ) . $problem->url; my $contact_url = $c->uri_for( "/contact" ); - $c->stash->{message} = sprintf(_("You have already answered this questionnaire. If you have a question, please get in touch, or view your problem.\n"), $contact_url, $problem_url); - $c->stash->{template} = 'errors/generic.html'; - $c->detach; + my $message = sprintf(_("You have already answered this questionnaire. If you have a question, please get in touch, or view your problem.\n"), $contact_url, $problem_url); + $c->detach('/page_error_400_bad_request', [ $message ]); } unless ( $problem->is_visible ) { @@ -86,8 +85,8 @@ Display couldn't locate problem error message sub missing_problem : Private { my ( $self, $c ) = @_; - $c->stash->{message} = _("I'm afraid we couldn't locate your problem in the database.\n"); - $c->stash->{template} = 'errors/generic.html'; + my $message = _("I'm afraid we couldn't locate your problem in the database.\n"); + $c->detach('/page_error_400_bad_request', [ $message ]); } sub submit_creator_fixed : Private { -- cgit v1.2.3