Skip to content

Commit

Permalink
fix: avoids call to DB when checking for queryset (#4552)
Browse files Browse the repository at this point in the history
  • Loading branch information
Ali-D-Akbar authored Feb 3, 2025
1 parent caae73b commit 883b144
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion course_discovery/apps/course_metadata/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -1183,7 +1183,8 @@ def search(
QuerySet
"""
query = clean_query(query)
queryset = queryset or cls.objects.all()
if queryset is None:
queryset = cls.objects.all()

if query == '(*)':
# Early-exit optimization. Wildcard searching is very expensive in elasticsearch. And since we just
Expand Down

0 comments on commit 883b144

Please sign in to comment.