diff options
author | Dave Arter <davea@mysociety.org> | 2018-04-03 12:45:01 +0100 |
---|---|---|
committer | Dave Arter <davea@mysociety.org> | 2018-04-03 12:45:01 +0100 |
commit | 15259c13abb273ba300462854bcbd1d6aa9b3568 (patch) | |
tree | ae8515c19fda940e5a9813cdb3f098c80c07e82c /bin/send-comments | |
parent | a719de88c7b11d3259d229fae2eb37f747ced0b1 (diff) | |
parent | 5938e38771062bb739efebf25932665d7894c975 (diff) |
Merge branch 'issues/commercial/793-buckinghamshire-demo'
Diffstat (limited to 'bin/send-comments')
-rwxr-xr-x | bin/send-comments | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/bin/send-comments b/bin/send-comments index aecedcb08..4293417f5 100755 --- a/bin/send-comments +++ b/bin/send-comments @@ -100,7 +100,18 @@ while ( my $body = $bodies->next ) { } while ( my $comment = $comments->next ) { - my $cobrand = FixMyStreet::Cobrand->get_class_for_moniker($comment->cobrand)->new(); + my $cobrand = $body->get_cobrand_handler || + FixMyStreet::Cobrand->get_class_for_moniker($comment->cobrand)->new(); + + # Some cobrands (e.g. Buckinghamshire) don't want to receive updates + # from anyone except the original problem reporter. + if ($cobrand->call_hook(should_skip_sending_update => $comment)) { + unless (defined $comment->get_extra_metadata('cobrand_skipped_sending')) { + $comment->set_extra_metadata(cobrand_skipped_sending => 1); + $comment->update; + } + next; + } # TODO actually this should be OK for any devolved endpoint if original Open311->can_be_devolved, presumably if ( 0 ) { # Check can_be_devolved and do this properly if set |