aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDave Arter <davea@mysociety.org>2019-10-21 16:05:18 +0100
committerDave Arter <davea@mysociety.org>2019-10-21 16:05:18 +0100
commit57def06f96f6d95f41b7201c477c9439bbe2fd13 (patch)
treec760e19252b7ff612abf5efa8cfa594eed879122
parentf26f9c7cae830550fbbdb1392936556d5ef56109 (diff)
[Peterborough] Exclude email categories from cobrand
-rw-r--r--perllib/FixMyStreet/Cobrand/Peterborough.pm13
1 files changed, 13 insertions, 0 deletions
diff --git a/perllib/FixMyStreet/Cobrand/Peterborough.pm b/perllib/FixMyStreet/Cobrand/Peterborough.pm
index 46242fcf3..9aa807cda 100644
--- a/perllib/FixMyStreet/Cobrand/Peterborough.pm
+++ b/perllib/FixMyStreet/Cobrand/Peterborough.pm
@@ -82,4 +82,17 @@ sub open311_munge_update_params {
$params->{description} = "[Customer FMS update] " . $params->{description};
}
+sub categories_restriction {
+ my ($self, $rs) = @_;
+ # Categories covering Peterborough have a mixture of Open311 and Email
+ # send methods. Peterborough only want specific categories to be visible on
+ # their cobrand, not the email categories from FMS.com.
+ # The FMS.com categories have a devolved send_method set to Email, so we can
+ # filter these out.
+ return $rs->search( { -or => [
+ 'me.send_method' => undef, # Open311 categories
+ 'me.send_method' => '', # Open311 categories that have been edited in the admin
+ ] } );
+}
+
1;