Skip to content

Commit

Permalink
fix: update condition
Browse files Browse the repository at this point in the history
  • Loading branch information
Ali-Salman29 committed Nov 26, 2024
1 parent 6d907b6 commit 45fb387
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions cms/djangoapps/contentstore/views/course.py
Original file line number Diff line number Diff line change
Expand Up @@ -621,9 +621,7 @@ 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:
if not (order_query and course_overviews):
return course_overviews
try:
return course_overviews.order_by(order_query)
Expand Down

0 comments on commit 45fb387

Please sign in to comment.