Skip to content

Commit

Permalink
Fixed #5991 -- Marked the generated HTML for newforms.extra.SelectDat…
Browse files Browse the repository at this point in the history
…eWidget as

safe. Patch from alberto.piai@gmail.com.


git-svn-id: http://code.djangoproject.com/svn/django/trunk@6723 bcc190cf-cafb-0310-a4f2-bffc1f526a37
  • Loading branch information
malcolmt committed Nov 28, 2007
1 parent 1c87a7b commit 5a5a71e
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion django/newforms/extras/widgets.py
Expand Up @@ -6,6 +6,7 @@

from django.newforms.widgets import Widget, Select
from django.utils.dates import MONTHS
from django.utils.safestring import mark_safe

__all__ = ('SelectDateWidget',)

Expand Down Expand Up @@ -51,7 +52,7 @@ def render(self, name, value, attrs=None):
select_html = Select(choices=year_choices).render(self.year_field % name, year_val)
output.append(select_html)

return u'\n'.join(output)
return mark_safe(u'\n'.join(output))

def value_from_datadict(self, data, files, name):
y, m, d = data.get(self.year_field % name), data.get(self.month_field % name), data.get(self.day_field % name)
Expand Down

0 comments on commit 5a5a71e

Please sign in to comment.