aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorStruan Donald <struan@exo.org.uk>2019-06-03 10:11:06 +0100
committerStruan Donald <struan@exo.org.uk>2019-06-14 13:52:29 +0100
commitf0d0629b26ab72343009603be9244f27f44b0e7e (patch)
treece3312a8fbbb02cfe965c9f78817b10004e31b0d
parent5e501b7cb4fc38541475facfd2dfb05190c79f06 (diff)
[Rutland] limit report summaries to 254 characters
-rw-r--r--perllib/FixMyStreet/Cobrand/Rutland.pm4
-rw-r--r--web/cobrands/fixmystreet-uk-councils/council_validation_rules.js4
2 files changed, 8 insertions, 0 deletions
diff --git a/perllib/FixMyStreet/Cobrand/Rutland.pm b/perllib/FixMyStreet/Cobrand/Rutland.pm
index 407d43d14..97bcfe637 100644
--- a/perllib/FixMyStreet/Cobrand/Rutland.pm
+++ b/perllib/FixMyStreet/Cobrand/Rutland.pm
@@ -12,6 +12,10 @@ sub council_url { return 'rutland'; }
sub report_validation {
my ($self, $report, $errors) = @_;
+ if ( length( $report->title ) > 254 ) {
+ $errors->{title} = sprintf( _('Summaries are limited to %s characters in length. Please shorten your summary'), 254 );
+ }
+
if ( length( $report->name ) > 40 ) {
$errors->{name} = sprintf( _('Names are limited to %d characters in length.'), 40 );
}
diff --git a/web/cobrands/fixmystreet-uk-councils/council_validation_rules.js b/web/cobrands/fixmystreet-uk-councils/council_validation_rules.js
index ee3dfde88..49c23db89 100644
--- a/web/cobrands/fixmystreet-uk-councils/council_validation_rules.js
+++ b/web/cobrands/fixmystreet-uk-councils/council_validation_rules.js
@@ -17,6 +17,10 @@ body_validation_rules = {
'Lincolnshire County Council': confirm_validation_rules,
'Bath and North East Somerset Council': confirm_validation_rules,
'Rutland County Council': {
+ title: {
+ required: true,
+ maxlength: 254
+ },
name: {
required: true,
maxlength: 40