Skip to content

Commit 2c479ec

Browse files
authored
Merge pull request #5357 from rtfd/fix-small-search-bug
Fix search bug when an empty list of objects_id was passed
2 parents 9f9d240 + a325feb commit 2c479ec

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

readthedocs/search/tasks.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,10 @@ def index_objects_to_es(
1414
app_label, model_name, document_class, index_name=None, chunk=None, objects_id=None
1515
):
1616

17-
assert not (chunk and objects_id), "You can not pass both chunk and objects_id"
17+
assert not (chunk and objects_id), \
18+
"You can not pass both chunk and objects_id"
19+
assert (chunk or objects_id), \
20+
"You must pass a chunk or objects_id"
1821

1922
model = apps.get_model(app_label, model_name)
2023
document = _get_document(model=model, document_class=document_class)

0 commit comments

Comments
 (0)