Skip to content

Commit

Permalink
fix: Handle empty course_overviews in get_courses_order_by function
Browse files Browse the repository at this point in the history
  • Loading branch information
Ali-Salman29 committed Nov 26, 2024
1 parent bfa756b commit 6d907b6
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions cms/djangoapps/contentstore/views/course.py
Original file line number Diff line number Diff line change
Expand Up @@ -621,6 +621,8 @@ def get_courses_order_by(order_query, course_overviews):
order_query (str): any string used to order Course Overviews.
course_overviews (Course Overview objects): queryset to be ordered.
"""
if not course_overviews:
return []
if not order_query:
return course_overviews
try:
Expand Down

0 comments on commit 6d907b6

Please sign in to comment.