Opened 11 years ago
Closed 11 years ago
#20618 closed Bug (fixed)
Giving a field an empty label breaks `BoundField.label_tag` (IndexError)
Reported by: | Baptiste Mispelon | Owned by: | Baptiste Mispelon |
---|---|---|---|
Component: | Forms | Version: | dev |
Severity: | Release blocker | Keywords: | |
Cc: | Triage Stage: | Unreviewed | |
Has patch: | no | Needs documentation: | no |
Needs tests: | no | Patch needs improvement: | no |
Easy pickings: | no | UI/UX: | no |
Description
The following code shows the regression:
from django import forms class F(forms.Form): foo = forms.CharField(label='') print(F()['foo'].label_tag())
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
Note:
See TracTickets
for help on using tickets.
In 3128f3d38d1db0bc01da9a4bf4be81119079d73a: