﻿id	summary	reporter	owner	description	type	status	component	version	severity	resolution	keywords	cc	stage	has_patch	needs_docs	needs_tests	needs_better_patch	easy	ui_ux
20617	"AuthenticationForm ignores setting ""username"" field's label to an empty string"	xor-xor	nobody	"When I inherit ""django.contrib.auth.forms.AuthenticationForm"" and set the ""username"" field's label to an empty string:

{{{
username = forms.CharField(label='')
}}}

...it is ignored and the ""Username:"" label is rendered in HTML output.

Trying the same thing with ""password"" field works as expected (i.e. label is not rendered), so this behaviour is inconsistent.

I think it is related to the following if statement in django/contrib/auth/forms.py file:

{{{
if self.fields['username'].label is None:
    self.fields['username'].label = capfirst(self.username_field.verbose_name)
}}}
(see also: [https://code.djangoproject.com/ticket/19573 ticket #19573])
"	Uncategorized	closed	contrib.auth	1.5	Normal	duplicate			Unreviewed	0	0	0	0	0	0
