Code Review
/
releng-testresults.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
review
|
tree
raw
|
patch
| inline |
side by side
(parent:
f97aba6
)
bugfix: Exception when the results is empty
author
SerenaFeng
<feng.xiaowei@zte.com.cn>
Wed, 28 Jun 2017 03:22:59 +0000
(11:22 +0800)
committer
SerenaFeng
<feng.xiaowei@zte.com.cn>
Wed, 28 Jun 2017 06:05:13 +0000
(14:05 +0800)
list operation crash when limit is not provided, error message:
OperationFailure: the limit must be positive
JIRA: RELENG-265
Change-Id: Id8db93b594010d054a71d301d9c42eed113c12e1
Signed-off-by: SerenaFeng <feng.xiaowei@zte.com.cn>
testapi/opnfv_testapi/resources/handlers.py
patch
|
blob
|
history
diff --git
a/testapi/opnfv_testapi/resources/handlers.py
b/testapi/opnfv_testapi/resources/handlers.py
index
0234c8a
..
5c98c48
100644
(file)
--- 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})
- el
se
:
- pipelines.append({'$limit':
records_nr
})
+ el
if last > 0
:
+ pipelines.append({'$limit':
last
})
cursor = self._eval_db(self.table,
'aggregate',