sb
This commit is contained in:
parent
5de669cdaf
commit
1b205b94cc
1 changed files with 4 additions and 3 deletions
|
@ -157,9 +157,10 @@ def frontlist(v=None, sort="hot", page=1, t="all", ids_only=True, filter_words='
|
|||
if lt:
|
||||
posts = posts.filter(Submission.created_utc < lt)
|
||||
|
||||
if not (v and v.shadowbanned):
|
||||
posts=posts.join(Submission.author)
|
||||
posts=posts.filter(User.shadowbanned == False)
|
||||
if v:
|
||||
posts = posts.join(Submission.author).filter(or_(User.shadowbanned==False, Submission.author_id==v.id))
|
||||
else:
|
||||
posts = posts.join(Submission.author).filter(User.shadowbanned == False)
|
||||
|
||||
if sort == "hot":
|
||||
posts = sorted(posts.all(), key=lambda x: x.hotscore, reverse=True)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue