diff options
author | Struan Donald <struan@exo.org.uk> | 2019-04-03 12:11:49 +0100 |
---|---|---|
committer | Struan Donald <struan@exo.org.uk> | 2019-04-09 09:54:47 +0100 |
commit | 0e46602ffb3fa6f1b86474449972bd7d5572af61 (patch) | |
tree | fb91f7b4867205505b21249f20fbf50b5a9e9a6a /perllib | |
parent | 15c5006fa25799cd65ee4edd032b49b90513c839 (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.pm | 8 |
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; |