Ticket #7391: 7391-formset-as-table-mark-safe.diff

File 7391-formset-as-table-mark-safe.diff, 983 bytes (added by Antti Kaihola, 16 years ago)

Adds the missing mark_safe() call to BaseFormSet.as_table()

  • django/newforms/formsets.py

     
    11from forms import Form
    22from django.utils.encoding import StrAndUnicode
     3from django.utils.safestring import mark_safe
    34from fields import IntegerField, BooleanField
    45from widgets import Media, HiddenInput, TextInput
    56from util import ErrorList, ValidationError
     
    258259        # probably should be. It might make sense to render each form as a
    259260        # table row with each field as a td.
    260261        forms = u' '.join([form.as_table() for form in self.forms])
    261         return u'\n'.join([unicode(self.management_form), forms])
     262        return mark_safe(u'\n'.join([unicode(self.management_form), forms]))
    262263
    263264# XXX: This API *will* change. Use at your own risk.
    264265def _formset_factory(form, formset=BaseFormSet, extra=1, can_order=False, can_delete=False):
Back to Top