diff options
author | Matthew Somerville <matthew@mysociety.org> | 2011-06-29 10:55:04 +0100 |
---|---|---|
committer | Matthew Somerville <matthew@mysociety.org> | 2011-06-29 22:44:02 +0100 |
commit | ab1e0e3b65ae971f6358973c58cf5ae447e5625d (patch) | |
tree | 50092d81972d3563aa77c34793fc7cef063730d8 /perllib/FixMyStreet/App/Controller/Questionnaire.pm | |
parent | ba55bd341e99c674619ac6295526038b5770fe3e (diff) |
Log someone in following questionnaire link.
Diffstat (limited to 'perllib/FixMyStreet/App/Controller/Questionnaire.pm')
-rwxr-xr-x | perllib/FixMyStreet/App/Controller/Questionnaire.pm | 23 |
1 files changed, 8 insertions, 15 deletions
diff --git a/perllib/FixMyStreet/App/Controller/Questionnaire.pm b/perllib/FixMyStreet/App/Controller/Questionnaire.pm index 19d057958..0126fe566 100755 --- a/perllib/FixMyStreet/App/Controller/Questionnaire.pm +++ b/perllib/FixMyStreet/App/Controller/Questionnaire.pm @@ -19,24 +19,17 @@ Deals with report questionnaires. =cut -=head2 load_questionnaire +=head2 check_questionnaire -Loads the questionnaire from the database, and checks it still needs answering -and is in the right state. Also finds out if this user has answered the -"ever reported" question before. +Checks the questionnaire still needs answering and is in the right state. Also +finds out if this user has answered the "ever reported" question before. =cut -sub load_questionnaire : Private { +sub check_questionnaire : Private { my ( $self, $c ) = @_; - my $questionnaire = $c->model('DB::Questionnaire')->find( - { id => $c->stash->{id} }, - { prefetch => 'problem' } - ); - $c->detach('missing_problem') unless $questionnaire; - - $c->stash->{questionnaire} = $questionnaire; + my $questionnaire = $c->stash->{questionnaire}; my $problem_id = $questionnaire->problem_id; @@ -149,8 +142,8 @@ sub submit_creator_fixed : Private { sub submit_standard : Private { my ( $self, $c ) = @_; - $c->forward( '/tokens/load_questionnaire_id', [ $c->req->params->{token} ] ); - $c->forward( 'load_questionnaire' ); + $c->forward( '/tokens/load_questionnaire', [ $c->req->params->{token} ] ); + $c->forward( 'check_questionnaire' ); $c->forward( 'process_questionnaire' ); my $problem = $c->stash->{problem}; @@ -261,7 +254,7 @@ sub process_questionnaire : Private { # Sent here from email token action. Simply load and display questionnaire. sub index : Private { my ( $self, $c ) = @_; - $c->forward( 'load_questionnaire' ); + $c->forward( 'check_questionnaire' ); $c->forward( 'display' ); } |