Opened 3 years ago

Closed 3 years ago

#20618 closed Bug (fixed)

Giving a field an empty label breaks `BoundField.label_tag` (IndexError)

Reported by: bmispelon Owned by: bmispelon
Component: Forms Version: master
Severity: Release blocker Keywords:
Cc: Triage Stage: Unreviewed
Has patch: no Needs documentation:
Needs tests: Patch needs improvement:
Easy pickings: no UI/UX: no


The following code shows the regression:

from django import forms

class F(forms.Form):
    foo = forms.CharField(label='')


On django 1.5, this prints <label for="id_foo"></label>. On master, it raises an IndexError.

This is regression was introduced by 584bd14dcfdee9585fec7794d53ce120ea73d0bc.
Previously, calling the label_tag on a field with an empty label would

Change History (1)

comment:1 Changed 3 years ago by Baptiste Mispelon <bmispelon@…>

  • Resolution set to fixed
  • Status changed from new to closed

In 3128f3d38d1db0bc01da9a4bf4be81119079d73a:

Fixed #20618 -- Fixed regression in BoundField.label_tag.

Note: See TracTickets for help on using tickets.
Back to Top