fix: sort the user stats to maintain best matched username first

This commit is contained in:
SaadYousaf
2022-07-14 19:52:18 +05:00
committed by Saad Yousaf
parent ef6cb318bf
commit 800120ce95

View File

@@ -78,4 +78,5 @@ def add_stats_for_users_with_no_discussion_content(course_stats, users_in_course
'active_flags': 0,
'inactive_flags': 0,
})
updated_course_stats = sorted(updated_course_stats, key=lambda d: len(d['username']))
return updated_course_stats