mirror of
https://github.com/django/django.git
synced 2025-08-04 19:08:28 +00:00
Fixed #16192 -- Made unique error messages in ModelForm customizable.
Overriding the error messages now works for both unique fields, unique_together and unique_for_date. This patch changed the overriding logic to allow customizing NON_FIELD_ERRORS since previously only fields' errors were customizable. Refs #20199. Thanks leahculver for the suggestion.
This commit is contained in:
parent
65131911db
commit
8847a0c601
11 changed files with 142 additions and 34 deletions
|
@ -233,8 +233,12 @@ field will raise. Pass in a dictionary with keys matching the error messages you
|
|||
want to override.
|
||||
|
||||
Error message keys include ``null``, ``blank``, ``invalid``, ``invalid_choice``,
|
||||
and ``unique``. Additional error message keys are specified for each field in
|
||||
the `Field types`_ section below.
|
||||
``unique``, and ``unique_for_date``. Additional error message keys are
|
||||
specified for each field in the `Field types`_ section below.
|
||||
|
||||
.. versionadded:: 1.7
|
||||
|
||||
The ``unique_for_date`` error message key was added.
|
||||
|
||||
``help_text``
|
||||
-------------
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue