Skip to content

Commit

Permalink
Use chain.from_iterable in registries.py (#278)
Browse files Browse the repository at this point in the history
  • Loading branch information
cool-RR authored Jun 18, 2020
1 parent 805d391 commit 86b4ce7
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions django_elasticsearch_dsl/registries.py
Original file line number Diff line number Diff line change
Expand Up @@ -152,9 +152,9 @@ def get_documents(self, models=None):
Get all documents in the registry or the documents for a list of models
"""
if models is not None:
return set(chain(*(self._models[model] for model in models
if model in self._models)))
return set(chain(*itervalues(self._indices)))
return set(chain.from_iterable(self._models[model] for model in models
if model in self._models))
return set(chain.from_iterable(itervalues(self._indices)))

def get_models(self):
"""
Expand Down

0 comments on commit 86b4ce7

Please sign in to comment.