forked from MarseyWorld/MarseyWorld
master
parent
5cf99be59f
commit
5c63c016b6
|
@ -469,12 +469,12 @@ def all_comments(v):
|
|||
@auth_required
|
||||
def transfers(v):
|
||||
|
||||
comments = g.db.query(Comment).filter(Comment.author_id == NOTIFICATIONS_ID, Comment.parent_submission == None, Comment.distinguish_level == 6, Comment.body_html.like("%</a> has transferred %"), Comment.created_utc == 0).order_by(Comment.id.desc())
|
||||
|
||||
if request.headers.get("Authorization"): return {"data": [x.json for x in comments.all()]}
|
||||
|
||||
page = int(request.values.get("page", 1))
|
||||
|
||||
comments = g.db.query(Comment).filter(Comment.author_id == NOTIFICATIONS_ID, Comment.parent_submission == None, Comment.distinguish_level == 6, Comment.body_html.like("%</a> has transferred %"), Comment.created_utc == 0).order_by(Comment.id.desc()).offset(25 * (page - 1)).limit(26).all()
|
||||
|
||||
comments = comments.offset(25 * (page - 1)).limit(26).all()
|
||||
next_exists = len(comments) > 25
|
||||
comments = comments[:25]
|
||||
|
||||
if request.headers.get("Authorization"): return {"data": [x.json for x in comments]}
|
||||
return render_template("transfers.html", v=v, page=page, comments=comments, standalone=True, next_exists=next_exists)
|
Loading…
Reference in New Issue