Skip to content
Open
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
7 changes: 7 additions & 0 deletions misago/categories/proxy.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,13 @@ def get_categories_menu(self) -> list[dict]:
elif category["parent_id"] in children:
children[category["parent_id"]].append(category)

# Sort top categories by lft to maintain order
top_categories.sort(key=lambda c: c["lft"])

# Sort child categories by lft to maintain order
for child_list in children.values():
child_list.sort(key=lambda c: c["lft"])

# Flatten menu for React.js
menu_items: list[dict] = []
for category in top_categories:
Expand Down