diff options
author | Struan Donald <struan@exo.org.uk> | 2011-06-30 16:56:12 +0100 |
---|---|---|
committer | Struan Donald <struan@exo.org.uk> | 2011-06-30 16:56:12 +0100 |
commit | 0e6bb3e802c0614d64366bd19732b37a574dc12c (patch) | |
tree | 01b5d111754a0acef3f8a71da526ce1fbe59de55 /perllib/FixMyStreet/App/Controller/Questionnaire.pm | |
parent | b756440e4b5c0b356ee0d65d1647124317535c95 (diff) | |
parent | fb78afe61194ea9b6fbec9596d69627e315ab97f (diff) |
Merge branch 'master' of ssh://git.mysociety.org/data/git/public/fixmystreet into new_statuses
Conflicts:
perllib/FixMyStreet/App/Controller/Reports.pm
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 a146b85ce..90674b294 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; @@ -155,8 +148,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}; @@ -270,7 +263,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' ); } |