aboutsummaryrefslogtreecommitdiffstats
path: root/perllib/FixMyStreet/Script/Questionnaires.pm
diff options
context:
space:
mode:
authorDave Arter <davea@mysociety.org>2018-10-25 13:03:22 +0100
committerDave Arter <davea@mysociety.org>2018-10-26 09:53:44 +0100
commit0b127a05a982eca9de214ce2d524b244e8c934ec (patch)
tree7c59fb0e8142f7410cedb28aa2b7d6ff9461fbb6 /perllib/FixMyStreet/Script/Questionnaires.pm
parentd20ccf50a1cd7f844316d3db8809db74d813152b (diff)
Don’t send questionnaires for closed reports.
Fixes mysociety/fixmystreet-freshdesk#24.
Diffstat (limited to 'perllib/FixMyStreet/Script/Questionnaires.pm')
-rw-r--r--perllib/FixMyStreet/Script/Questionnaires.pm4
1 files changed, 3 insertions, 1 deletions
diff --git a/perllib/FixMyStreet/Script/Questionnaires.pm b/perllib/FixMyStreet/Script/Questionnaires.pm
index bcdaa06d6..aab4b9b75 100644
--- a/perllib/FixMyStreet/Script/Questionnaires.pm
+++ b/perllib/FixMyStreet/Script/Questionnaires.pm
@@ -53,7 +53,9 @@ sub send_questionnaires_period {
# Cobrands can also override sending per row if they wish
my $cobrand_send = $cobrand->call_hook('send_questionnaire', $row) // 1;
- if ($row->is_from_abuser || !$row->user->email_verified || !$cobrand_send) {
+ if ($row->is_from_abuser || !$row->user->email_verified ||
+ !$cobrand_send || $row->is_closed
+ ) {
$row->update( { send_questionnaire => 0 } );
next;
}