Skip to content

Commit

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

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

0 comments on commit f54ecab

Please sign in to comment.