-
Notifications
You must be signed in to change notification settings - Fork 105
Commit
- Loading branch information
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -166,7 +166,7 @@ class Fieldset(object): | |
|
||
def __init__(self, legend, *fields, **kwargs): | ||
self.fields = list(fields) | ||
self.legend = Template(legend) | ||
self.legend = unicode(legend) | ||
This comment has been minimized.
Sorry, something went wrong.
This comment has been minimized.
Sorry, something went wrong.
maraujop
Author
Collaborator
|
||
self.css_class = kwargs.get('css_class', '') | ||
self.css_id = kwargs.get('css_id', None) | ||
# Overrides class variable with an instance level variable | ||
|
@@ -177,7 +177,9 @@ def render(self, form, form_style, context): | |
for field in self.fields: | ||
fields += render_field(field, form, form_style, context) | ||
|
||
legend = u'%s' % self.legend.render(context) | ||
legend = '' | ||
if self.legend: | ||
legend = u'%s' % Template(self.legend).render(context) | ||
return render_to_string(self.template, Context({'fieldset': self, 'legend': legend, 'fields': fields, 'form_style': form_style})) | ||
|
||
|
||
|
If we use
unicode
here, lazy translation string would be translated when this fieldset is created and not when it is rendered.Isn't it maybe too early?