[Django] #20618: Giving a field an empty label breaks `BoundField.label_tag` (IndexError)

4 views
Skip to first unread message

Django

unread,
Jun 18, 2013, 11:34:26 AM6/18/13
to django-...@googlegroups.com
#20618: Giving a field an empty label breaks `BoundField.label_tag` (IndexError)
---------------------------------+-----------------------
Reporter: bmispelon | Owner: bmispelon
Type: Bug | Status: new
Component: Forms | Version: master
Severity: Release blocker | Keywords:
Triage Stage: Unreviewed | Has patch: 0
Easy pickings: 0 | UI/UX: 0
---------------------------------+-----------------------
The following code shows the regression:
{{{#!python
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

--
Ticket URL: <https://code.djangoproject.com/ticket/20618>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.

Django

unread,
Jun 18, 2013, 12:06:54 PM6/18/13
to django-...@googlegroups.com
#20618: Giving a field an empty label breaks `BoundField.label_tag` (IndexError)
-----------------------------+----------------------------
Reporter: bmispelon | Owner: bmispelon
Type: Bug | Status: closed
Component: Forms | Version: master
Severity: Release blocker | Resolution: fixed

Keywords: | Triage Stage: Unreviewed
Has patch: 0 | Easy pickings: 0
UI/UX: 0 |
-----------------------------+----------------------------
Changes (by Baptiste Mispelon <bmispelon@…>):

* status: new => closed
* resolution: => fixed


Comment:

In [changeset:"3128f3d38d1db0bc01da9a4bf4be81119079d73a"]:
{{{
#!CommitTicketReference repository=""
revision="3128f3d38d1db0bc01da9a4bf4be81119079d73a"
Fixed #20618 -- Fixed regression in `BoundField.label_tag`.
}}}

--
Ticket URL: <https://code.djangoproject.com/ticket/20618#comment:1>

Reply all
Reply to author
Forward
0 new messages