remotes/1693045480750635534/spooky-22
Aevann1 2021-08-06 17:36:54 +02:00
parent ca584c9bd1
commit 631626f07e
2 changed files with 4 additions and 9 deletions

View File

@ -75,11 +75,6 @@ def post_pid_comment_cid(cid, pid=None, anything=None, v=None):
current_ids = [comment.id]
exile=g.db.query(ModAction
).filter_by(
kind="exile_user"
).distinct(ModAction.target_comment_id).subquery()
for i in range(6 - context):
if v:
blocking = v.blocking.subquery()
@ -103,15 +98,15 @@ def post_pid_comment_cid(cid, pid=None, anything=None, v=None):
)
if sort == "top":
comments = sorted(comments.all(), key=lambda x: x.score, reverse=True)
comments = sorted(comments.all(), key=lambda x: x[0].score, reverse=True)
elif sort == "bottom":
comments = sorted(comments.all(), key=lambda x: x.score)
comments = sorted(comments.all(), key=lambda x: x[0].score)
elif sort == "new":
comments = comments.order_by(Comment.created_utc.desc()).all()
elif sort == "old":
comments = comments.order_by(Comment.created_utc.asc()).all()
elif sort == "controversial":
comments = sorted(comments.all(), key=lambda x: x.score_disputed, reverse=True)
comments = sorted(comments.all(), key=lambda x: x[0].score_disputed, reverse=True)
elif sort == "random":
c = comments.all()
comments = random.sample(c, k=len(c))

View File

@ -323,7 +323,7 @@ def changelog(v):
def random_post(v):
if v and v.is_banned and not v.unban_utc: return render_template("seized.html")
x = g.db.query(Submission).filter(Submission.deleted_utc == 0, Submission.is_banned == False, Submission.score > 20)
x = g.db.query(Submission).filter(Submission.deleted_utc == 0, Submission.is_banned == False)
total = x.count()
n = random.randint(0, total - 1)