Skip to content

Commit 8c9990f

Browse files
committed
var name cleanup for _find_selected_options
1 parent 7371a45 commit 8c9990f

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

src/reactpy_django/forms/transforms.py

+7-7
Original file line numberDiff line numberDiff line change
@@ -73,21 +73,21 @@ def intercept_anchor_links(vdom_tree: VdomDict) -> VdomDict:
7373
return vdom_tree
7474

7575

76-
def _find_selected_options(vdom_tree: VdomDict | Any) -> list[str]:
76+
def _find_selected_options(vdom_node: Any) -> list[str]:
7777
"""Recursively iterate through the tree to find all <option> tags with the 'selected' prop.
7878
Removes the 'selected' prop and returns a list of the 'value' prop of each selected <option>."""
79-
if not isinstance(vdom_tree, dict):
79+
if not isinstance(vdom_node, dict):
8080
return []
8181

8282
selected_options = []
83-
if vdom_tree["tagName"] == "option" and "attributes" in vdom_tree:
84-
value = vdom_tree["attributes"].setdefault("value", vdom_tree["children"][0])
83+
if vdom_node["tagName"] == "option" and "attributes" in vdom_node:
84+
value = vdom_node["attributes"].setdefault("value", vdom_node["children"][0])
8585

86-
if "selected" in vdom_tree["attributes"]:
87-
vdom_tree["attributes"].pop("selected")
86+
if "selected" in vdom_node["attributes"]:
87+
vdom_node["attributes"].pop("selected")
8888
selected_options.append(value)
8989

90-
for child in vdom_tree.get("children", []):
90+
for child in vdom_node.get("children", []):
9191
selected_options.extend(_find_selected_options(child))
9292

9393
return selected_options

0 commit comments

Comments
 (0)