diff --git a/files/routes/search.py b/files/routes/search.py index 8ab716f2f..96cc056d9 100644 --- a/files/routes/search.py +++ b/files/routes/search.py @@ -279,7 +279,7 @@ def searchusers(v): total=users.count() users=[x for x in users.offset(25 * (page-1)).limit(26)] - next_exists=(len(users)==26) + next_exists=(len(users)>25) users=users[:25] diff --git a/files/routes/static.py b/files/routes/static.py index d1ec45219..c4b20cb97 100644 --- a/files/routes/static.py +++ b/files/routes/static.py @@ -175,7 +175,7 @@ def log(v): if v and v.admin_level == 6: actions = g.db.query(ModAction).order_by(ModAction.id.desc()).offset(25 * (page - 1)).limit(26).all() else: actions=g.db.query(ModAction).filter(ModAction.kind!="shadowban", ModAction.kind!="unshadowban", ModAction.kind!="club", ModAction.kind!="unclub").order_by(ModAction.id.desc()).offset(25*(page-1)).limit(26).all() - next_exists=len(actions)==26 + next_exists=len(actions)>25 actions=actions[:25] return render_template("log.html", v=v, actions=actions, next_exists=next_exists, page=page) diff --git a/files/routes/users.py b/files/routes/users.py index c46500cae..67059ffcf 100644 --- a/files/routes/users.py +++ b/files/routes/users.py @@ -700,7 +700,7 @@ def saved_posts(v, username): ids=v.saved_idlist(page=page) - next_exists=len(ids)==26 + next_exists=len(ids)>25 ids=ids[:25] @@ -722,14 +722,17 @@ def saved_comments(v, username): page=int(request.values.get("page",1)) - ids=v.saved_comment_idlist(page=page) + firstrange = 25 * (page - 1) + secondrange = firstrange+26 - next_exists=len(ids)==26 + ids=v.saved_comment_idlist()[firstrange:secondrange] + + next_exists=len(ids) > 25 ids=ids[:25] print(ids) - + listing = get_comments(ids, v=v)