Skip to content

Commit

Permalink
Merge branch 'fix-90-fieldset-ugettext_lazy' of git:https://github.com/bmih…
Browse files Browse the repository at this point in the history
…elac/django-uni-form
  • Loading branch information
maraujop committed Sep 17, 2011
2 parents 53002bf + 15fd28d commit fd3d126
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions uni_form/helpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -251,7 +251,7 @@ class Fieldset(object):
def __init__(self, legend, *fields, **kwargs):
self.css_class = kwargs.get('css_class', None)
self.css_id = kwargs.get('css_id', None)
self.legend = Template(legend)
self.legend = legend
self.fields = list(fields)

def render(self, form, form_style, context):
Expand All @@ -264,7 +264,8 @@ def render(self, form, form_style, context):
html += u' class="%s"' % form_style
html += '>'

html += self.legend and (u'<legend>%s</legend>' % self.legend.render(context)) or ''
if self.legend:
html += u'<legend>%s</legend>' % Template(unicode(self.legend)).render(context)
for field in self.fields:
html += render_field(field, form, form_style, context)
html += u'</fieldset>'
Expand Down

0 comments on commit fd3d126

Please sign in to comment.