Permalink
Browse files

Refs #29131 -- Fixed space handling in ArrayField's item_invalid mess…

…age.
  • Loading branch information...
hramezani authored and timgraham committed May 13, 2018
1 parent 2405833 commit 31ce1f74334add625a4ed82b531d769828237882
@@ -19,7 +19,7 @@
class ArrayField(CheckFieldDefaultMixin, Field):
empty_strings_allowed = False
default_error_messages = {
- 'item_invalid': _('Item %(nth)s in the array did not validate: '),
+ 'item_invalid': _('Item %(nth)s in the array did not validate:'),
'nested_array_mismatch': _('Nested arrays must have the same length.'),
}
_default_hint = ('list', '[]')
@@ -13,7 +13,7 @@
class SimpleArrayField(forms.CharField):
default_error_messages = {
- 'item_invalid': _('Item %(nth)s in the array did not validate: '),
+ 'item_invalid': _('Item %(nth)s in the array did not validate:'),
}
def __init__(self, base_field, *, delimiter=',', max_length=None, min_length=None, **kwargs):
@@ -167,7 +167,7 @@ def needs_multipart_form(self):
class SplitArrayField(forms.Field):
default_error_messages = {
- 'item_invalid': _('Item %(nth)s in the array did not validate: '),
+ 'item_invalid': _('Item %(nth)s in the array did not validate:'),
}
def __init__(self, base_field, size, *, remove_trailing_nulls=False, **kwargs):
@@ -17,7 +17,7 @@ def prefix_validation_error(error, prefix, code, params):
# ngettext calls require a count parameter and are converted
# to an empty string if they are missing it.
message=format_lazy(
- '{}{}',
+ '{} {}',
SimpleLazyObject(lambda: prefix % params),
SimpleLazyObject(lambda: error.message % error_params),
),

0 comments on commit 31ce1f7

Please sign in to comment.