From 45fb3870c30cc70bbb9295e3c7fb79624f0ecd15 Mon Sep 17 00:00:00 2001 From: Ali-Salman29 Date: Tue, 26 Nov 2024 12:56:13 +0100 Subject: [PATCH] fix: update condition --- cms/djangoapps/contentstore/views/course.py | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/cms/djangoapps/contentstore/views/course.py b/cms/djangoapps/contentstore/views/course.py index ed0787833881..487faf13adcf 100644 --- a/cms/djangoapps/contentstore/views/course.py +++ b/cms/djangoapps/contentstore/views/course.py @@ -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)