Skip to content

Commit

Permalink
refactor: don't evaluate queryset before filtering/ordering
Browse files Browse the repository at this point in the history
  • Loading branch information
mariajgrimaldi committed Dec 2, 2024
1 parent 6cccb83 commit d833a62
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions cms/djangoapps/contentstore/views/course.py
Original file line number Diff line number Diff line change
Expand Up @@ -575,9 +575,10 @@ def filter_ccx(course_access):

if course_keys:
courses_list = CourseOverview.get_all_courses(filter_={'id__in': course_keys})

if not courses_list:
return [], []
else:
# If no course keys are found for the current user, then return without filtering
# or ordering the courses list.
return courses_list, []

search_query, order, active_only, archived_only = get_query_params_if_present(request)
courses_list = get_filtered_and_ordered_courses(
Expand Down

0 comments on commit d833a62

Please sign in to comment.