Merge pull request #21547 from edx/BOM-227

BOM-227
This commit is contained in:
Ayub
2019-09-05 09:47:45 +05:00
committed by GitHub

View File

@@ -305,7 +305,8 @@ def _sort_map_entries(category_map, sort_alpha):
for title, category in category_map["subcategories"].items():
things.append((title, category, TYPE_SUBCATEGORY))
_sort_map_entries(category_map["subcategories"][title], sort_alpha)
category_map["children"] = [(x[0], x[2]) for x in sorted(things, key=lambda x: x[1]["sort_key"])]
key_method = lambda x: x[1]["sort_key"] if x[1]["sort_key"] is not None else ''
category_map["children"] = [(x[0], x[2]) for x in sorted(things, key=key_method)]
def get_discussion_category_map(course, user, divided_only_if_explicit=False, exclude_unstarted=True):