diff options
author | Matthew Somerville <matthew@mysociety.org> | 2015-02-20 11:24:32 +0000 |
---|---|---|
committer | Matthew Somerville <matthew@mysociety.org> | 2015-02-20 11:24:32 +0000 |
commit | 834d18012ab64e340d06f539fee17d34e0cf7675 (patch) | |
tree | 6478756405efd2a2c04b3bc9d490d396c9112d0f /perllib/FixMyStreet/App/Controller/Questionnaire.pm | |
parent | 7b227dea1532f3e68c369d8447611349e8cb44b6 (diff) | |
parent | 25d518e794b7d95525edaa9357adec48a4172c24 (diff) |
Merge branch '972-completion-adverts'
Diffstat (limited to 'perllib/FixMyStreet/App/Controller/Questionnaire.pm')
-rwxr-xr-x | perllib/FixMyStreet/App/Controller/Questionnaire.pm | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/perllib/FixMyStreet/App/Controller/Questionnaire.pm b/perllib/FixMyStreet/App/Controller/Questionnaire.pm index 70edcabe3..f6cc33e74 100755 --- a/perllib/FixMyStreet/App/Controller/Questionnaire.pm +++ b/perllib/FixMyStreet/App/Controller/Questionnaire.pm @@ -67,9 +67,16 @@ token), or the mini own-report one (when we'll have a problem ID). sub submit : Path('submit') { my ( $self, $c ) = @_; - if ( $c->req->params->{token} ) { + if (my $token = $c->req->params->{token}) { + if ($token eq '_test_') { + $c->stash->{been_fixed} = $c->req->params->{been_fixed}; + $c->stash->{new_state} = $c->req->params->{new_state}; + $c->stash->{template} = 'questionnaire/completed.html'; + return; + } $c->forward('submit_standard'); - } elsif ( $c->req->params->{problem} ) { + } elsif (my $p = $c->req->params->{problem}) { + $c->detach('creator_fixed') if $p eq '_test_'; $c->forward('submit_creator_fixed'); } else { $c->detach( '/page_error_404_not_found' ); @@ -106,6 +113,7 @@ sub submit_creator_fixed : Private { } my $problem = $c->cobrand->problems->find( { id => $c->stash->{problem_id} } ); + $c->stash->{problem} = $problem; # you should not be able to answer questionnaires about problems # that you've not submitted |