From 99aa4e0990b7d32756c92b9163c4ab83e5db021f Mon Sep 17 00:00:00 2001 From: Awoodwhale Date: Sat, 25 Mar 2023 20:41:09 +0800 Subject: [PATCH] fix: fix article title show --- app/admin_service.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/app/admin_service.py b/app/admin_service.py index 9cbb75e..0e2a308 100644 --- a/app/admin_service.py +++ b/app/admin_service.py @@ -70,6 +70,10 @@ def article(): article_len = get_number_of_articles() context["article_number"] = article_len context["text_list"] = get_page_articles(_cur_page, _page_size) + _articles = get_page_articles(_cur_page, _page_size) + for article in _articles: # 获取每篇文章的title + article.title = article.text.split("\n")[0] + context["text_list"] = _articles if request.method == "GET": try: