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):
|
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.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,
|
||||||
votes.c.comment_id == Comment.id,
|
votes.c.comment_id == Comment.id,
|
||||||
isouter=True
|
isouter=True
|
||||||
|
@ -269,9 +269,7 @@ def viewmore(v, pid, sort, offset):
|
||||||
comment.is_blocked = c[3] or 0
|
comment.is_blocked = c[3] or 0
|
||||||
output.append(comment)
|
output.append(comment)
|
||||||
|
|
||||||
pinned = [c[0] for c in comments.filter(Comment.is_pinned != None).all()]
|
comments = comments.filter(Comment.level == 1)
|
||||||
|
|
||||||
comments = comments.filter(Comment.level == 1, Comment.is_pinned == None)
|
|
||||||
|
|
||||||
if sort == "new":
|
if sort == "new":
|
||||||
comments = comments.order_by(Comment.created_utc.desc())
|
comments = comments.order_by(Comment.created_utc.desc())
|
||||||
|
@ -305,7 +303,6 @@ def viewmore(v, pid, sort, offset):
|
||||||
|
|
||||||
comments = comments.all()
|
comments = comments.all()
|
||||||
|
|
||||||
if len(comments) > 60:
|
|
||||||
comments2 = []
|
comments2 = []
|
||||||
count = 0
|
count = 0
|
||||||
post = get_post(pid, v=v)
|
post = get_post(pid, v=v)
|
||||||
|
@ -324,7 +321,6 @@ def viewmore(v, pid, sort, offset):
|
||||||
|
|
||||||
if len(comments) == len(comments2): offset = None
|
if len(comments) == len(comments2): offset = None
|
||||||
comments = comments2
|
comments = comments2
|
||||||
else: offset = None
|
|
||||||
|
|
||||||
return render_template("comments.html", v=v, comments=comments, render_replies=True, pid=pid, sort=sort, offset=offset)
|
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