Skip to content

Commit 77402db

Browse files
committed
elaborating on the bug correction
1 parent 647ef9a commit 77402db

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

app.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -697,9 +697,9 @@ def history_redirect():
697697

698698

699699
@app.route("/history/<int:page>")
700-
def history(page):
700+
def history(page: int):
701701
current_id = int(stats["broadcast"]["id"])
702-
query_list = [f"p.id = '{post_id}'" for post_id in range(current_id - 5, current_id + 1)]
702+
query_list = [f"p.id = '{post_id}'" for post_id in range(current_id - (5 * page) + 1, current_id - (5 * (page - 1)) + 1)]
703703
query_str = " OR ".join(query_list)
704704

705705
try:
@@ -708,7 +708,7 @@ def history(page):
708708
except StopIteration:
709709
abort(404)
710710

711-
return render_template("history.html", post_list=reversed(post_list), hist_page=int(page))
711+
return render_template("history.html", post_list=reversed(post_list), hist_page=page)
712712

713713

714714
@app.route("/post/")

0 commit comments

Comments
 (0)