diff options
| author | Jon Dufresne <jon.dufresne@gmail.com> | 2017-03-20 10:12:55 -0700 |
|---|---|---|
| committer | Tim Graham <timograham@gmail.com> | 2017-03-20 13:12:55 -0400 |
| commit | 7edeeb74fe1e82c1b4a736670b13b0508b223a06 (patch) | |
| tree | 3b3f034560e7384690cef96b1acfba8d228a3471 | |
| parent | 0c6c859d4edf6e462d000da21b4fa5009cb2696f (diff) | |
Fixed #27957 -- Removed technical terms from InlineForeignKeyField/ModelMultipleChoiceField error messages.
| -rw-r--r-- | django/forms/models.py | 4 | ||||
| -rw-r--r-- | tests/forms_tests/tests/test_error_messages.py | 4 |
2 files changed, 4 insertions, 4 deletions
diff --git a/django/forms/models.py b/django/forms/models.py index 895ebbd59d..c8626f57b2 100644 --- a/django/forms/models.py +++ b/django/forms/models.py @@ -1059,7 +1059,7 @@ class InlineForeignKeyField(Field): """ widget = HiddenInput 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): @@ -1229,7 +1229,7 @@ class ModelMultipleChoiceField(ModelChoiceField): 'list': _('Enter a list of values.'), 'invalid_choice': _('Select a valid choice. %(value)s is not one of the' ' 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, diff --git a/tests/forms_tests/tests/test_error_messages.py b/tests/forms_tests/tests/test_error_messages.py index 40b085f55b..aaee0bb5d3 100644 --- a/tests/forms_tests/tests/test_error_messages.py +++ b/tests/forms_tests/tests/test_error_messages.py @@ -276,8 +276,8 @@ class FormsErrorMessagesTestCase(SimpleTestCase, AssertFormErrorsMixin): self.assertHTMLEqual( t.render(Context({'form': f})), '<ul class="errorlist"><li>field<ul class="errorlist">' - '<li>"<script>" is not a valid value for a ' - 'primary key.</li></ul></li></ul>' + '<li>"<script>" is not a valid value.</li>' + '</ul></li></ul>' ) |
