fdssfd
This commit is contained in:
parent
ae87bce45b
commit
c98d482564
1 changed files with 12 additions and 10 deletions
|
@ -135,7 +135,7 @@ def post_id(pid, anything=None, v=None):
|
||||||
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 == post.id, Comment.author_id != AUTOPOLLER_ID, Comment.level == 1, Comment.is_pinned == None).join(
|
comments=comments.filter(Comment.parent_submission == post.id, 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
|
||||||
|
@ -149,6 +149,16 @@ def post_id(pid, anything=None, v=None):
|
||||||
isouter=True
|
isouter=True
|
||||||
)
|
)
|
||||||
|
|
||||||
|
output = []
|
||||||
|
for c in comments.all():
|
||||||
|
comment = c[0]
|
||||||
|
comment.voted = c[1] or 0
|
||||||
|
comment.is_blocking = c[2] or 0
|
||||||
|
comment.is_blocked = c[3] or 0
|
||||||
|
output.append(comment)
|
||||||
|
|
||||||
|
comments = comments.filter(Comment.level == 1)
|
||||||
|
|
||||||
if sort == "new":
|
if sort == "new":
|
||||||
comments = comments.order_by(Comment.created_utc.desc())
|
comments = comments.order_by(Comment.created_utc.desc())
|
||||||
elif sort == "old":
|
elif sort == "old":
|
||||||
|
@ -163,15 +173,7 @@ def post_id(pid, anything=None, v=None):
|
||||||
offset = int(request.values.get("offset", 0))
|
offset = int(request.values.get("offset", 0))
|
||||||
if offset: comments = comments.offset(offset)
|
if offset: comments = comments.offset(offset)
|
||||||
|
|
||||||
output = []
|
comments2 = [c[0] for c in comments.all()]
|
||||||
for c in comments.all():
|
|
||||||
comment = c[0]
|
|
||||||
comment.voted = c[1] or 0
|
|
||||||
comment.is_blocking = c[2] or 0
|
|
||||||
comment.is_blocked = c[3] or 0
|
|
||||||
output.append(comment)
|
|
||||||
|
|
||||||
comments2 = output
|
|
||||||
else:
|
else:
|
||||||
comments = g.db.query(Comment).join(User, User.id == Comment.author_id).filter(User.shadowbanned == None, Comment.parent_submission == post.id, Comment.author_id != AUTOPOLLER_ID, Comment.level == 1, Comment.is_pinned == None)
|
comments = g.db.query(Comment).join(User, User.id == Comment.author_id).filter(User.shadowbanned == None, Comment.parent_submission == post.id, Comment.author_id != AUTOPOLLER_ID, Comment.level == 1, Comment.is_pinned == None)
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue