ошибку не заметил

main
Сергей Ванюшкин 2023-10-11 19:16:37 +03:00
parent 911d3ef845
commit 40274136fe
3 changed files with 7 additions and 3 deletions

4
.gitignore vendored
View File

@ -1,4 +1,6 @@
pyproger/upload/* pyproger/uploads/*
!pyproger/uploads/.gitkeep
config.ini config.ini
data/ data/

View File

@ -91,10 +91,12 @@ def get_posts_by_tag(page=1, tag=None):
per_page = current_app.config.get("POSTS_ON_PAGE") per_page = current_app.config.get("POSTS_ON_PAGE")
posts, total = get_all_posts_by_tag(tag, page, per_page) posts, total = get_all_posts_by_tag(tag, page, per_page)
total_pages = total // per_page + [0, 1][total % per_page != 0]
if posts is None: if posts is None:
abort(404) abort(404)
total_pages = total // per_page + [0, 1][total % per_page != 0]
list_pages = [ list_pages = [
x for x in range(1, total_pages + 1) if x >= page - 2 and x <= page + 2 x for x in range(1, total_pages + 1) if x >= page - 2 and x <= page + 2
] ]

View File

@ -1,7 +1,7 @@
import os import os
# Настройки блога # Настройки блога
MYLIPOSTS_ON_PAGE = 6 POSTS_ON_PAGE = 6
# Тема оформления админ панели # Тема оформления админ панели
FLASK_ADMIN_SWATCH = "slate" FLASK_ADMIN_SWATCH = "slate"