From 977a546cd51fa0e9d88451dcdfe59c68c9017e8d Mon Sep 17 00:00:00 2001 From: Struan Donald Date: Mon, 30 Sep 2019 16:17:26 +0100 Subject: [IsleOfWight] hide reports created before go live --- perllib/FixMyStreet/Cobrand/IsleOfWight.pm | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/perllib/FixMyStreet/Cobrand/IsleOfWight.pm b/perllib/FixMyStreet/Cobrand/IsleOfWight.pm index 49356e3ae..753ac3b72 100644 --- a/perllib/FixMyStreet/Cobrand/IsleOfWight.pm +++ b/perllib/FixMyStreet/Cobrand/IsleOfWight.pm @@ -45,6 +45,17 @@ sub updates_disallowed { return 1; } +# Island Roads don't want any reports made before their go-live date visible on +# their cobrand at all. +sub problems_restriction { + my ($self, $rs) = @_; + return $rs if FixMyStreet->config('STAGING_SITE') or FixMyStreet->test_mode; + my $table = ref $rs eq 'FixMyStreet::DB::ResultSet::Nearby' ? 'problem' : 'me'; + return $rs->to_body($self->body)->search({ + "$table.confirmed" => { '>=', '2019-09-30' } + }); +} + sub get_geocoder { 'OSM' } sub open311_pre_send { -- cgit v1.2.3