Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions validmind/template.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,8 +53,9 @@ def _convert_sections_to_section_tree(

if start_section_id and not section_tree:
raise ValueError(f"Section {start_section_id} not found in template")

return sorted(section_tree, key=lambda x: x.get("order", 0))
# sort the section tree by the order of the sections in the template (if provided)
# set the order to 9999 for the sections that do not have an order
return sorted(section_tree, key=lambda x: x.get("order", 9999))


def _create_content_widget(content: Dict[str, Any]) -> Widget:
Expand Down