From: Morgan Richomme Date: Wed, 28 Jun 2017 15:33:05 +0000 (+0000) Subject: Merge "bugfix: Exception when the results is empty" X-Git-Url: https://gerrit.opnfv.org/gerrit/gitweb?a=commitdiff_plain;h=1f0e9ddc87b2259e977463143521448b9ce66945;hp=ef31c232e9ec0d4bb8ec992a6541ba51a1eee2df;p=releng.git Merge "bugfix: Exception when the results is empty" --- diff --git a/utils/test/testapi/opnfv_testapi/resources/handlers.py b/utils/test/testapi/opnfv_testapi/resources/handlers.py index 0234c8a73..5c98c48ef 100644 --- a/utils/test/testapi/opnfv_testapi/resources/handlers.py +++ b/utils/test/testapi/opnfv_testapi/resources/handlers.py @@ -127,8 +127,8 @@ class GenericApiHandler(web.RequestHandler): total_pages += 1 pipelines.append({'$skip': (page - 1) * per_page}) pipelines.append({'$limit': per_page}) - else: - pipelines.append({'$limit': records_nr}) + elif last > 0: + pipelines.append({'$limit': last}) cursor = self._eval_db(self.table, 'aggregate',