diff --git a/rero_ils/modules/libraries/api.py b/rero_ils/modules/libraries/api.py index 4aed092b24..748f9d5cd8 100644 --- a/rero_ils/modules/libraries/api.py +++ b/rero_ils/modules/libraries/api.py @@ -64,9 +64,8 @@ def get_libraries_by_organisation_pid(self, org_pid, fields=None): query = self.filter('term', organisation__pid=org_pid) if fields: query = query.source(includes=fields) - response = query.execute() - for hit in response.hits.hits: - yield hit._source + for result in query.scan(): + yield result class Library(IlsRecord):