Skip to content

Commit

Permalink
Fixed render_field for formset
Browse files Browse the repository at this point in the history
  • Loading branch information
Your Name committed Jun 11, 2021
1 parent 7ce02ff commit c453797
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions crispy_forms/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,9 @@ def render_field( # noqa: C901

try:
# Injecting HTML attributes into field's widget, Django handles rendering these
if hasattr(form, "forms"): # if form is formset
form = form.forms[0]
form.crispy_field_template = None
bound_field = form[field]
field_instance = bound_field.field
if attrs is not None:
Expand Down

0 comments on commit c453797

Please sign in to comment.