Skip to content

Commit 0b177eb

Browse files
committed
Merge branch 'arnaudlimbourg-patch-1' into develop
2 parents 97ee548 + 3247d78 commit 0b177eb

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

src/models.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -215,7 +215,13 @@ def reindex_all(self, batch_size=1000):
215215
result = None
216216
counts = 0
217217
batch = []
218-
for instance in self.model.objects.all():
218+
219+
if getattr(self, 'get_queryset', None):
220+
qs = self.get_queryset()
221+
else:
222+
qs = self.model.objects.all()
223+
224+
for instance in qs:
219225
if self.should_index:
220226
if not self.should_index(instance):
221227
continue # should not index

0 commit comments

Comments
 (0)