forked from rDrama/rDrama
1
0
Fork 0

remove code irrelevant now (not broken this time I hope)

master
Aevann1 2022-09-05 01:21:48 +02:00
parent 0c32d56cd6
commit 842300ac6e
1 changed files with 5 additions and 14 deletions

View File

@ -176,9 +176,7 @@ def post_id(pid, anything=None, v=None, sub=None):
comments = sort_comments(sort, comments) comments = sort_comments(sort, comments)
first = [c[0] for c in comments.filter(or_(and_(Comment.wordle_result == None), func.length(Comment.body_html) > 100)).all()] comments = [c[0] for c in comments.all()]
second = [c[0] for c in comments.filter(or_(Comment.wordle_result != None), func.length(Comment.body_html) <= 100).all()]
comments = first + second
else: else:
pinned = g.db.query(Comment).filter(Comment.parent_submission == post.id, Comment.stickied != None).all() pinned = g.db.query(Comment).filter(Comment.parent_submission == post.id, Comment.stickied != None).all()
@ -186,9 +184,7 @@ def post_id(pid, anything=None, v=None, sub=None):
comments = sort_comments(sort, comments) comments = sort_comments(sort, comments)
first = comments.filter(or_(and_(Comment.wordle_result == None), func.length(Comment.body_html) > 100)).all() comments = comments.all()
second = comments.filter(or_(Comment.wordle_result != None), func.length(Comment.body_html) <= 100).all()
comments = first + second
offset = 0 offset = 0
ids = set() ids = set()
@ -302,18 +298,13 @@ def viewmore(v, pid, sort, offset):
comments = sort_comments(sort, comments) comments = sort_comments(sort, comments)
first = [c[0] for c in comments.filter(or_(and_(Comment.wordle_result == None), func.length(Comment.body_html) > 100)).all()] comments = [c[0] for c in comments.all()]
second = [c[0] for c in comments.filter(or_(Comment.wordle_result != None), func.length(Comment.body_html) <= 100).all()]
comments = first + second
else: else:
comments = g.db.query(Comment).join(Comment.author).filter(User.shadowbanned == None, Comment.parent_submission == pid, Comment.level == 1, Comment.stickied == None, Comment.id.notin_(ids)) comments = g.db.query(Comment).join(Comment.author).filter(User.shadowbanned == None, Comment.parent_submission == pid, Comment.level == 1, Comment.stickied == None, Comment.id.notin_(ids))
comments = sort_comments(sort, comments) comments = sort_comments(sort, comments)
first = comments.filter(or_(and_(Comment.wordle_result == None), func.length(Comment.body_html) > 100)).all() comments = comments.offset(offset).all()
second = comments.filter(or_(Comment.wordle_result != None), func.length(Comment.body_html) <= 100).all()
comments = first + second
comments = comments[offset:]
comments2 = [] comments2 = []
count = 0 count = 0
@ -866,7 +857,7 @@ def submit_post(v, sub=None):
send_repeatable_notification(v.id, text) send_repeatable_notification(v.id, text)
v.ban(reason="Spamming.", v.ban(reason="Spamming.",
days=1) days=1)
for post in similar_posts + similar_urls: for post in similar_posts + similar_urls:
post.is_banned = True post.is_banned = True