Prefetch CourseOverview.image_set when loading the course_api
This commit is contained in:
@@ -392,7 +392,7 @@ class CourseListSearchViewTest(CourseApiTestViewMixin, ModuleStoreTestCase, Sear
|
||||
self.setup_user(self.audit_user)
|
||||
|
||||
# These query counts were found empirically
|
||||
query_counts = [93, 81, 81, 81, 81, 81, 81, 81, 81, 81, 25]
|
||||
query_counts = [65, 52, 52, 52, 52, 52, 52, 52, 52, 52, 22]
|
||||
ordered_course_ids = sorted([str(cid) for cid in (course_ids + [c.id for c in self.courses])])
|
||||
|
||||
self.clear_caches()
|
||||
|
||||
@@ -464,7 +464,8 @@ def get_courses(user, org=None, filter_=None):
|
||||
'modes',
|
||||
queryset=CourseMode.objects.exclude(mode_slug__in=CourseMode.CREDIT_MODES),
|
||||
to_attr='selectable_modes',
|
||||
)
|
||||
),
|
||||
'image_set',
|
||||
)
|
||||
|
||||
permission_name = configuration_helpers.get_value(
|
||||
|
||||
Reference in New Issue
Block a user