diff options
author | Matthew Somerville <matthew@mysociety.org> | 2020-01-08 16:16:48 +0000 |
---|---|---|
committer | Matthew Somerville <matthew@mysociety.org> | 2020-01-09 17:31:45 +0000 |
commit | 4a3b51a366825b42f451f5eeac93b990a602e57e (patch) | |
tree | ad293c091cf3947cde776e9f9b6fb6e50fe9b832 /perllib/FixMyStreet/Cobrand | |
parent | 65ca47eda62a45bf081128b507c94c7b18a77a00 (diff) |
[TfL] Add hook to restrict to safety reports.
Diffstat (limited to 'perllib/FixMyStreet/Cobrand')
-rw-r--r-- | perllib/FixMyStreet/Cobrand/TfL.pm | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/perllib/FixMyStreet/Cobrand/TfL.pm b/perllib/FixMyStreet/Cobrand/TfL.pm index eedbc41b5..cc4b4f345 100644 --- a/perllib/FixMyStreet/Cobrand/TfL.pm +++ b/perllib/FixMyStreet/Cobrand/TfL.pm @@ -127,6 +127,16 @@ sub problems_sql_restriction { return $q; } +sub inactive_reports_filter { + my ($self, $time, $rs) = @_; + if ($time < 7*12) { + $rs = $rs->search({ extra => { like => '%safety_critical,T5:value,T2:no%' } }); + } else { + $rs = $rs->search({ extra => { like => '%safety_critical,T5:value,T3:yes%' } }); + } + return $rs; +} + sub password_expiry { return if FixMyStreet->test_mode; # uncoverable statement |