fd
This commit is contained in:
parent
e17767edda
commit
f9d35c0f40
1 changed files with 5 additions and 2 deletions
|
@ -162,6 +162,11 @@ 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 v and v.shadowbanned:
|
||||
posts = posts.join(Submission.author).filter(or_(User.shadowbanned == False, User.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)
|
||||
elif sort == "new":
|
||||
|
@ -203,8 +208,6 @@ def frontlist(v=None, sort="hot", page=1, t="all", ids_only=True, filter_words='
|
|||
post.views = post.views + random.randint(7,10)
|
||||
g.db.add(post)
|
||||
|
||||
posts = [p for p in posts if not p.author.shadowbanned]
|
||||
|
||||
next_exists = (len(posts) > 25)
|
||||
|
||||
posts = posts[:25]
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue