diff options
author | Morgan Richomme <morgan.richomme@orange.com> | 2017-06-28 15:33:05 +0000 |
---|---|---|
committer | Gerrit Code Review <gerrit@opnfv.org> | 2017-06-28 15:33:05 +0000 |
commit | b796b675b977bbb20e0265cad88225b25cf3cfc4 (patch) | |
tree | 50eb44b71fa7c4959c0d5aa886c8f6f75fe12b0b /testapi | |
parent | 7c95bbee4afbb0c75b43a38046783748552fd418 (diff) | |
parent | ee40278f19c672fdb52f9c72a620d49744a190bd (diff) |
Merge "bugfix: Exception when the results is empty"
Diffstat (limited to 'testapi')
-rw-r--r-- | testapi/opnfv_testapi/resources/handlers.py | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/testapi/opnfv_testapi/resources/handlers.py b/testapi/opnfv_testapi/resources/handlers.py index 0234c8a..5c98c48 100644 --- a/testapi/opnfv_testapi/resources/handlers.py +++ b/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', |