From 09beb2c72e0b7d9a262b2ea75c2a6c64c85d007b Mon Sep 17 00:00:00 2001 From: Ayub khan Date: Wed, 4 Sep 2019 14:36:06 +0500 Subject: [PATCH] BOM-227 python3 compatibility --- lms/djangoapps/discussion/django_comment_client/utils.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lms/djangoapps/discussion/django_comment_client/utils.py b/lms/djangoapps/discussion/django_comment_client/utils.py index 158b2ae73c..ffc994769a 100644 --- a/lms/djangoapps/discussion/django_comment_client/utils.py +++ b/lms/djangoapps/discussion/django_comment_client/utils.py @@ -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):