﻿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
29247	A custom blank value in model field choices doesn't work when using named groups	orlnub123	nobody	"While sifting through the source code to understand the internals for a package I'm making, I stumbled upon what looked like a bug.

These lines right here:
{{{
named_groups = isinstance(choices[0][1], (list, tuple))
blank_defined = not named_groups and any(choice in ('', None) for choice, __ in choices)
}}}
And indeed a bug it was.

The problem was that, had you defined your choices first with a group and then later on a choice that defined the blank value, the current implementation would skip right over it! So you would end up with having both the default blank value and the one you've defined, which doesn't look very pretty.

I've created a pull request on github that fixes the issue [https://github.com/django/django/pull/9813 here.]"	Bug	closed	Database layer (models, ORM)	dev	Normal	fixed	choices		Accepted	1	0	0	1	0	0
