Code Review
/
pti
/
o2.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
review
|
tree
raw
|
inline
| side by side
Fix install O2 on subcloud failed
[pti/o2.git]
/
o2common
/
views
/
pagination_route.py
diff --git
a/o2common/views/pagination_route.py
b/o2common/views/pagination_route.py
index
c595d9f
..
a6c5495
100644
(file)
--- a/
o2common/views/pagination_route.py
+++ b/
o2common/views/pagination_route.py
@@
-13,7
+13,8
@@
# limitations under the License.
from urllib.parse import urlparse
# limitations under the License.
from urllib.parse import urlparse
-from flask import abort
+
+from o2common.views.route_exception import BadRequestException
from o2common.helper import o2logging
logger = o2logging.get_logger(__name__)
from o2common.helper import o2logging
logger = o2logging.get_logger(__name__)
@@
-28,7
+29,8
@@
def link_header(full_path: str, ret):
page_current = ret.pop('page_current')
if page_current > page_total:
page_current = ret.pop('page_current')
if page_current > page_total:
- abort(400, "Page size {} bad request.".format(page_current))
+ raise BadRequestException(
+ "Page size {} bad request.".format(page_current))
if 0 == count:
return [], {'X-Total-Count': count}
if 0 == count:
return [], {'X-Total-Count': count}