From f17995a35caa1821c73cc03e84ba716d42820ba6 Mon Sep 17 00:00:00 2001 From: Awoodwhale Date: Sat, 25 Mar 2023 21:31:32 +0800 Subject: [PATCH] fix: using new pagination mod func --- app/admin_service.py | 2 +- app/templates/admin_manage_article.html | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/app/admin_service.py b/app/admin_service.py index 0e2a308..92150bd 100644 --- a/app/admin_service.py +++ b/app/admin_service.py @@ -49,7 +49,7 @@ def article(): 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 + 1 + max(1, int(request.args.get("page", 1))), _article_number // _page_size + (_article_number % _page_size > 0) ) # 最小的page是1 except ValueError: return "page parmas must be int!" diff --git a/app/templates/admin_manage_article.html b/app/templates/admin_manage_article.html index ef1542c..99c2ef6 100644 --- a/app/templates/admin_manage_article.html +++ b/app/templates/admin_manage_article.html @@ -83,7 +83,7 @@