Fixed #27957 -- Removed technical terms from InlineForeignKeyField/ModelMultipleChoiceField error messages.
This commit is contained in:
parent
0c6c859d4e
commit
7edeeb74fe
|
@ -1059,7 +1059,7 @@ class InlineForeignKeyField(Field):
|
||||||
"""
|
"""
|
||||||
widget = HiddenInput
|
widget = HiddenInput
|
||||||
default_error_messages = {
|
default_error_messages = {
|
||||||
'invalid_choice': _('The inline foreign key did not match the parent instance primary key.'),
|
'invalid_choice': _('The inline value did not match the parent instance.'),
|
||||||
}
|
}
|
||||||
|
|
||||||
def __init__(self, parent_instance, *args, pk_field=False, to_field=None, **kwargs):
|
def __init__(self, parent_instance, *args, pk_field=False, to_field=None, **kwargs):
|
||||||
|
@ -1229,7 +1229,7 @@ class ModelMultipleChoiceField(ModelChoiceField):
|
||||||
'list': _('Enter a list of values.'),
|
'list': _('Enter a list of values.'),
|
||||||
'invalid_choice': _('Select a valid choice. %(value)s is not one of the'
|
'invalid_choice': _('Select a valid choice. %(value)s is not one of the'
|
||||||
' available choices.'),
|
' available choices.'),
|
||||||
'invalid_pk_value': _('"%(pk)s" is not a valid value for a primary key.')
|
'invalid_pk_value': _('"%(pk)s" is not a valid value.')
|
||||||
}
|
}
|
||||||
|
|
||||||
def __init__(self, queryset, required=True, widget=None, label=None,
|
def __init__(self, queryset, required=True, widget=None, label=None,
|
||||||
|
|
|
@ -276,8 +276,8 @@ class FormsErrorMessagesTestCase(SimpleTestCase, AssertFormErrorsMixin):
|
||||||
self.assertHTMLEqual(
|
self.assertHTMLEqual(
|
||||||
t.render(Context({'form': f})),
|
t.render(Context({'form': f})),
|
||||||
'<ul class="errorlist"><li>field<ul class="errorlist">'
|
'<ul class="errorlist"><li>field<ul class="errorlist">'
|
||||||
'<li>"<script>" is not a valid value for a '
|
'<li>"<script>" is not a valid value.</li>'
|
||||||
'primary key.</li></ul></li></ul>'
|
'</ul></li></ul>'
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue