Ticket #9111: safestring-r9066.diff
File safestring-r9066.diff, 1.1 KB (added by , 16 years ago) |
---|
-
django/forms/forms.py
5 5 from copy import deepcopy 6 6 7 7 from django.utils.datastructures import SortedDict 8 from django.utils.html import escape 8 from django.utils.html import escape, conditional_escape 9 9 from django.utils.encoding import StrAndUnicode, smart_unicode, force_unicode 10 10 from django.utils.safestring import mark_safe 11 11 … … 140 140 output, hidden_fields = [], [] 141 141 for name, field in self.fields.items(): 142 142 bf = BoundField(self, field, name) 143 bf_errors = self.error_class([ escape(error) for error in bf.errors]) # Escape and cache in local variable.143 bf_errors = self.error_class([conditional_escape(error) for error in bf.errors]) # Escape and cache in local variable. 144 144 if bf.is_hidden: 145 145 if bf_errors: 146 146 top_errors.extend([u'(Hidden field %s) %s' % (name, force_unicode(e)) for e in bf_errors])