Skip to content

Commit

Permalink
added context to Fieldset render
Browse files Browse the repository at this point in the history
  • Loading branch information
fwannmacher committed Feb 7, 2024
1 parent 6d50351 commit b97bf8e
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion crispy_forms/layout.py
Original file line number Diff line number Diff line change
Expand Up @@ -584,7 +584,9 @@ def render(self, form, context, template_pack=TEMPLATE_PACK, **kwargs):
legend = SafeString("")

template = self.get_template_name(template_pack)
return render_to_string(template, {"fieldset": self, "legend": legend, "fields": fields})
context = context.flatten()
context.update({"fieldset": self, "legend": legend, "fields": fields})
return render_to_string(template, context)


class MultiField(LayoutObject):
Expand Down

0 comments on commit b97bf8e

Please sign in to comment.