Skip to content

Commit b36f7ea

Browse files
authored
Fix performance for enrollments API w/ 0 results (#3360)
1 parent ce54ea2 commit b36f7ea

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

courses/models.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1673,6 +1673,9 @@ def mapper(course_run_enrollment):
16731673

16741674
@staticmethod
16751675
def filter(course_run_and_user_ids):
1676+
if not course_run_and_user_ids:
1677+
return CourseRunCertificate.objects.none()
1678+
16761679
id_filters = Q()
16771680

16781681
# django 5.1 supports this via
@@ -1701,6 +1704,9 @@ def mapper(course_run_enrollment):
17011704

17021705
@staticmethod
17031706
def filter(course_run_and_user_ids):
1707+
if not course_run_and_user_ids:
1708+
return CourseRunGrade.objects.none()
1709+
17041710
id_filters = Q()
17051711

17061712
# django 5.1 supports this via

0 commit comments

Comments
 (0)