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

Change History (1)

comment:1 by Baptiste Mispelon <bmispelon@…>, 11 years ago

Resolution: fixed
Status: newclosed

In 3128f3d38d1db0bc01da9a4bf4be81119079d73a:

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

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