admin_service.py: do not need to have seperate lines for a statement.
parent
c284893097
commit
cd562a745c
|
@ -60,13 +60,10 @@ def article():
|
|||
return is_admin
|
||||
|
||||
_article_number = get_number_of_articles()
|
||||
|
||||
try:
|
||||
_page_size = min(
|
||||
max(1, int(request.args.get("size", 5))), _article_number
|
||||
) # 最小的size是1
|
||||
_cur_page = min(
|
||||
max(1, int(request.args.get("page", 1))), _article_number // _page_size + (_article_number % _page_size > 0)
|
||||
) # 最小的page是1
|
||||
_page_size = min(max(1, int(request.args.get("size", 5))), _article_number) # 最小的size是1
|
||||
_cur_page = min(max(1, int(request.args.get("page", 1))), _article_number // _page_size + (_article_number % _page_size > 0)) # 最小的page是1
|
||||
except ValueError:
|
||||
return "page parameters must be int!"
|
||||
|
||||
|
|
Loading…
Reference in New Issue