diff options
| author | Tim Graham <timograham@gmail.com> | 2014-08-02 18:33:18 -0400 |
|---|---|---|
| committer | Tim Graham <timograham@gmail.com> | 2014-08-03 11:21:01 -0400 |
| commit | 0f2ceee0254349ee4ac7d472d3efe67ee161a917 (patch) | |
| tree | 557f664c5fc08c1b85f213b62c98f1ad776a7bf1 /django/forms | |
| parent | 44169a00c1fe7c130a8b9774e3b02ccce524a3eb (diff) | |
Fixed #23151 -- Deprecated RegexField.error_message.
Thanks Baptiste Mispelon for the suggestion.
Diffstat (limited to 'django/forms')
| -rw-r--r-- | django/forms/fields.py | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/django/forms/fields.py b/django/forms/fields.py index 6e44ccfbb7..36f13472eb 100644 --- a/django/forms/fields.py +++ b/django/forms/fields.py @@ -25,7 +25,7 @@ from django.forms.widgets import ( from django.utils import formats from django.utils.encoding import smart_text, force_str, force_text from django.utils.ipv6 import clean_ipv6_address -from django.utils.deprecation import RemovedInDjango19Warning +from django.utils.deprecation import RemovedInDjango19Warning, RemovedInDjango20Warning from django.utils import six from django.utils.six.moves.urllib.parse import urlsplit, urlunsplit from django.utils.translation import ugettext_lazy as _, ungettext_lazy @@ -531,6 +531,11 @@ class RegexField(CharField): """ # error_message is just kept for backwards compatibility: if error_message is not None: + warnings.warn( + "The 'error_message' argument is deprecated. Use " + "Field.error_messages['invalid'] instead.", + RemovedInDjango20Warning, stacklevel=2 + ) error_messages = kwargs.get('error_messages') or {} error_messages['invalid'] = error_message kwargs['error_messages'] = error_messages |
