summaryrefslogtreecommitdiffstats
path: root/utils/test/testapi/opnfv_testapi/resources/handlers.py
diff options
context:
space:
mode:
authorMorgan Richomme <morgan.richomme@orange.com>2017-06-28 15:33:05 +0000
committerGerrit Code Review <gerrit@opnfv.org>2017-06-28 15:33:05 +0000
commit1f0e9ddc87b2259e977463143521448b9ce66945 (patch)
tree5eff3f9bf9ba8acf7f39e70136546c3a079ea2ec /utils/test/testapi/opnfv_testapi/resources/handlers.py
parentef31c232e9ec0d4bb8ec992a6541ba51a1eee2df (diff)
parenta42e6289c90531df6a45293411ae353cd1e251f6 (diff)
Merge "bugfix: Exception when the results is empty"
Diffstat (limited to 'utils/test/testapi/opnfv_testapi/resources/handlers.py')
-rw-r--r--utils/test/testapi/opnfv_testapi/resources/handlers.py4
1 files changed, 2 insertions, 2 deletions
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',