mirror of
				https://github.com/django/django.git
				synced 2025-10-28 08:06:09 +00:00 
			
		
		
		
	Fixed #2727 -- Fixed problem with serialising error messages from validation.
Thanks, Ivan Saglaev. git-svn-id: http://code.djangoproject.com/svn/django/trunk@3816 bcc190cf-cafb-0310-a4f2-bffc1f526a37
This commit is contained in:
		| @@ -2,7 +2,7 @@ from django.core import validators | ||||
| from django.core.exceptions import PermissionDenied | ||||
| from django.utils.html import escape | ||||
| from django.conf import settings | ||||
| from django.utils.translation import gettext, gettext_lazy, ngettext | ||||
| from django.utils.translation import gettext, ngettext | ||||
|  | ||||
| FORM_FIELD_ID_PREFIX = 'id_' | ||||
|  | ||||
| @@ -343,7 +343,7 @@ class FormField(object): | ||||
|     def get_validation_errors(self, new_data): | ||||
|         errors = {} | ||||
|         if self.is_required and not new_data.get(self.field_name, False): | ||||
|             errors.setdefault(self.field_name, []).append(gettext_lazy('This field is required.')) | ||||
|             errors.setdefault(self.field_name, []).append(gettext('This field is required.')) | ||||
|             return errors | ||||
|         try: | ||||
|             for validator in self.validator_list: | ||||
|   | ||||
		Reference in New Issue
	
	Block a user