Skip to content

Commit bdbc922

Browse files
committed
Fix storing of optgroups in Choices._triples
In particular, when an optgroup is passed as a double (pair) to the `Choices` constructor, it should be converted to a triple before being stored in `_triples`.
1 parent 28b54cc commit bdbc922

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

model_utils/choices.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@ def _process(
103103
group_name = choice[0]
104104
subchoices = choice[1]
105105
tc: list[_Triple] = []
106-
triple_collector.append((group_name, tc))
106+
triple_collector.append((group_name, group_name, tc))
107107
dc: list[_Double] = []
108108
double_collector.append((group_name, dc))
109109
self._process(subchoices, tc, dc)

0 commit comments

Comments
 (0)