aboutsummaryrefslogtreecommitdiffstats
path: root/bin
diff options
context:
space:
mode:
authorDave Arter <davea@mysociety.org>2020-03-30 15:45:12 +0100
committerMatthew Somerville <matthew@mysociety.org>2020-03-31 18:08:07 +0100
commit5c315c880126efc9ad0dc8f4550a7e91955b41b4 (patch)
treecb373b9502f5836384ec367ad2f935dfe387c485 /bin
parentdc0e1638e2bba9924355a11a49eaf4f3bf9671b8 (diff)
[Buckinghamshire] Update off-road flytipping.
Instead of sending off-road flytipping reports to the district, now that Buckinghamshire is unitary we instead recategorise them into a new email specific “Flytipping (off-road)” category which is handled in the same way as other ex-district categories with the borough_email_addresses cobrand feature, and omitted from the dropdown by the categories_restriction cobrand method.
Diffstat (limited to 'bin')
-rwxr-xr-xbin/fixmystreet.com/buckinghamshire-flytipping20
1 files changed, 15 insertions, 5 deletions
diff --git a/bin/fixmystreet.com/buckinghamshire-flytipping b/bin/fixmystreet.com/buckinghamshire-flytipping
index 70a37ea34..d42467521 100755
--- a/bin/fixmystreet.com/buckinghamshire-flytipping
+++ b/bin/fixmystreet.com/buckinghamshire-flytipping
@@ -57,12 +57,22 @@ sub find_problems {
$time_param = { '<', \$to };
}
- # Fetch all Flytipping problems sent only to districts, between $from and $to
- my $q = FixMyStreet::DB->resultset("Problem")->search(
- \[ "? @> regexp_split_to_array(bodies_str, ',')", [ {} => \@district_ids ] ]
- )->search({
+ # Fetch all Flytipping problems made off-road (i.e. those that previously
+ # would been sent only to districts) any any older ones which actually were
+ # sent to districts, between $from and $to
+ my $q = FixMyStreet::DB->resultset("Problem")->search([
+ # Reports sent to district, made before the unitary switchover
+ -and => [
+ \[ "? @> regexp_split_to_array(bodies_str, ',')", [ {} => \@district_ids ] ],
+ category => 'Flytipping'
+ ],
+ # Reports sent to Bucks Council after unitary switchover
+ {
+ bodies_str => $body->id,
+ category => 'Flytipping (off-road)'
+ }
+ ])->search({
state => [ FixMyStreet::DB::Result::Problem->open_states() ],
- category => 'Flytipping',
confirmed => $time_param,
});