aboutsummaryrefslogtreecommitdiffstats
path: root/perllib
diff options
context:
space:
mode:
authorStruan Donald <struan@exo.org.uk>2019-04-03 12:11:49 +0100
committerStruan Donald <struan@exo.org.uk>2019-04-09 09:54:47 +0100
commit0e46602ffb3fa6f1b86474449972bd7d5572af61 (patch)
treefb91f7b4867205505b21249f20fbf50b5a9e9a6a /perllib
parent15c5006fa25799cd65ee4edd032b49b90513c839 (diff)
[Northamptonshire] restrict title to 120 characters
Prevent people from using very long titles. Fixes mysociety/fixmystreet-commercial#1344
Diffstat (limited to 'perllib')
-rw-r--r--perllib/FixMyStreet/Cobrand/Northamptonshire.pm8
1 files changed, 8 insertions, 0 deletions
diff --git a/perllib/FixMyStreet/Cobrand/Northamptonshire.pm b/perllib/FixMyStreet/Cobrand/Northamptonshire.pm
index 945a1ac0d..683dc059c 100644
--- a/perllib/FixMyStreet/Cobrand/Northamptonshire.pm
+++ b/perllib/FixMyStreet/Cobrand/Northamptonshire.pm
@@ -94,4 +94,12 @@ sub open311_config {
# sending updates not part of initial phase
sub should_skip_sending_update { 1; }
+sub report_validation {
+ my ($self, $report, $errors) = @_;
+
+ if ( length( $report->title ) > 120 ) {
+ $errors->{title} = sprintf( _('Summaries are limited to %s characters in length. Please shorten your summary'), 120 );
+ }
+}
+
1;