helpers: fixed options generation typo.

This commit is contained in:
Marcin Kuzminski 2019-12-05 15:14:56 +01:00
parent b36b63f979
commit 84839b3559

View file

@ -191,7 +191,7 @@ def select(name, selected_values, options, id=NotGiven, **attrs):
option_group = options.add_optgroup(label)
for opt2 in value:
if isinstance(opt2, tuple) and len(opt2) == 2:
group_value, group_label = opt
group_value, group_label = opt2
elif isinstance(opt2, basestring):
group_value = group_label = opt2
else: