sdffsd
This commit is contained in:
parent
e2e23bb85e
commit
aba801f6c7
1 changed files with 20 additions and 24 deletions
|
@ -247,7 +247,7 @@ def viewmore(v, pid, sort, offset):
|
|||
if not (v and v.shadowbanned) and not (v and v.admin_level > 1):
|
||||
comments = comments.join(User, User.id == Comment.author_id).filter(User.shadowbanned == None)
|
||||
|
||||
comments=comments.filter(Comment.parent_submission == pid, Comment.author_id != AUTOPOLLER_ID).join(
|
||||
comments=comments.filter(Comment.parent_submission == pid, Comment.author_id != AUTOPOLLER_ID, Comment.is_pinned == None).join(
|
||||
votes,
|
||||
votes.c.comment_id == Comment.id,
|
||||
isouter=True
|
||||
|
@ -269,9 +269,7 @@ def viewmore(v, pid, sort, offset):
|
|||
comment.is_blocked = c[3] or 0
|
||||
output.append(comment)
|
||||
|
||||
pinned = [c[0] for c in comments.filter(Comment.is_pinned != None).all()]
|
||||
|
||||
comments = comments.filter(Comment.level == 1, Comment.is_pinned == None)
|
||||
comments = comments.filter(Comment.level == 1)
|
||||
|
||||
if sort == "new":
|
||||
comments = comments.order_by(Comment.created_utc.desc())
|
||||
|
@ -305,7 +303,6 @@ def viewmore(v, pid, sort, offset):
|
|||
|
||||
comments = comments.all()
|
||||
|
||||
if len(comments) > 60:
|
||||
comments2 = []
|
||||
count = 0
|
||||
post = get_post(pid, v=v)
|
||||
|
@ -324,7 +321,6 @@ def viewmore(v, pid, sort, offset):
|
|||
|
||||
if len(comments) == len(comments2): offset = None
|
||||
comments = comments2
|
||||
else: offset = None
|
||||
|
||||
return render_template("comments.html", v=v, comments=comments, render_replies=True, pid=pid, sort=sort, offset=offset)
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue