aboutsummaryrefslogtreecommitdiffstats
path: root/bin
diff options
context:
space:
mode:
Diffstat (limited to 'bin')
-rwxr-xr-xbin/fixmystreet.com/one-off-status-update12
1 files changed, 11 insertions, 1 deletions
diff --git a/bin/fixmystreet.com/one-off-status-update b/bin/fixmystreet.com/one-off-status-update
index 43e24417e..e9ba66c75 100755
--- a/bin/fixmystreet.com/one-off-status-update
+++ b/bin/fixmystreet.com/one-off-status-update
@@ -119,6 +119,9 @@ if ($northants) {
next;
}
+ # we don't want to update hidden reports
+ next if $p->state eq 'hidden';
+
my $new_state = get_state( $report );
unless ( $new_state ) {
@@ -140,7 +143,14 @@ if ($northants) {
my $text = $report->{Response_to_Customer};
# do not add a second response to customer if it's already there.
if ($text) {
- my $c = $p->comments->search({text => $text});
+ # sometimes there are extra spaces on the end in the database
+ # there's also quite a few occurrences of the text having minor corrections
+ # to the thank you which we don't want to send out an update for potentially
+ # weeks later
+ my $search_text = $text;
+ $search_text =~ s/\sthank you[.\s]*$//i;
+ my $search = { text => { ilike => "$search_text%" } };
+ my $c = $p->comments->search($search);
$text = '' if $c->count;
}