diff options
author | Matthew Somerville <matthew-github@dracos.co.uk> | 2017-08-29 10:41:01 +0100 |
---|---|---|
committer | Matthew Somerville <matthew-github@dracos.co.uk> | 2017-08-31 15:37:10 +0100 |
commit | 51a5bcc74982aefea4f7b364e2f4bc49596bd9bf (patch) | |
tree | ed76b4ea5dc1a1be65e34b33c8471c4c0472e2e8 /perllib | |
parent | efd398d47b9cd7c5e86190f2daa3ec1fa613484c (diff) |
Hide things needing fixed state if no fixed state.
Front page stats, update form question, list filtering, plus do not send
any questionnaires.
Diffstat (limited to 'perllib')
-rw-r--r-- | perllib/FixMyStreet/App.pm | 1 | ||||
-rw-r--r-- | perllib/FixMyStreet/Script/Questionnaires.pm | 3 |
2 files changed, 4 insertions, 0 deletions
diff --git a/perllib/FixMyStreet/App.pm b/perllib/FixMyStreet/App.pm index b7bbc8a0a..d782890bc 100644 --- a/perllib/FixMyStreet/App.pm +++ b/perllib/FixMyStreet/App.pm @@ -219,6 +219,7 @@ sub setup_request { mySociety::MaPit::configure( "http://$host/fakemapit/" ); } + $c->stash->{has_fixed_state} = FixMyStreet::DB::Result::Problem::fixed_states->{fixed}; $c->cobrand->call_hook('setup_states'); if (FixMyStreet->test_mode) { diff --git a/perllib/FixMyStreet/Script/Questionnaires.pm b/perllib/FixMyStreet/Script/Questionnaires.pm index 3f22eb150..ec6139d2d 100644 --- a/perllib/FixMyStreet/Script/Questionnaires.pm +++ b/perllib/FixMyStreet/Script/Questionnaires.pm @@ -16,6 +16,9 @@ sub send { sub send_questionnaires_period { my ( $period, $params ) = @_; + # Don't send if we don't have a fixed state + return unless FixMyStreet::DB::Result::Problem::fixed_states->{fixed}; + my $rs = FixMyStreet::DB->resultset('Questionnaire'); # Select all problems that need a questionnaire email sending |