diff options
| author | Loic Bistuer <loic.bistuer@sixmedia.com> | 2014-02-04 01:31:27 +0700 |
|---|---|---|
| committer | Tim Graham <timograham@gmail.com> | 2014-02-08 04:59:09 -0500 |
| commit | 8847a0c601e4261823b1726b2db73eec2ac17940 (patch) | |
| tree | ad62fc5aca51cc9446ae68d7033691be68c87940 /django/forms/forms.py | |
| parent | 65131911dba08dcc1451d71ae4d5101724d722f6 (diff) | |
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.
Diffstat (limited to 'django/forms/forms.py')
| -rw-r--r-- | django/forms/forms.py | 4 |
1 files changed, 1 insertions, 3 deletions
diff --git a/django/forms/forms.py b/django/forms/forms.py index bcc0d6dfa4..e34e089878 100644 --- a/django/forms/forms.py +++ b/django/forms/forms.py @@ -8,7 +8,7 @@ from collections import OrderedDict import copy import warnings -from django.core.exceptions import ValidationError +from django.core.exceptions import ValidationError, NON_FIELD_ERRORS from django.forms.fields import Field, FileField from django.forms.utils import flatatt, ErrorDict, ErrorList from django.forms.widgets import Media, MediaDefiningClass, TextInput, Textarea @@ -21,8 +21,6 @@ from django.utils import six __all__ = ('BaseForm', 'Form') -NON_FIELD_ERRORS = '__all__' - def pretty_name(name): """Converts 'first_name' to 'First name'""" |
