remotes/1693045480750635534/spooky-22
Aevann1 2022-02-25 18:34:55 +02:00
parent 9c02af1ed4
commit be445a99b1
1 changed files with 10 additions and 12 deletions

View File

@ -274,12 +274,11 @@ def frontlist(v=None, sort="hot", page=1, t="all", ids_only=True, ccmode="false"
elif subs:
if v and v.all_blocks: posts = posts.filter(or_(Submission.sub == None, Submission.sub.notin_(v.all_blocks)))
else:
if SITE_NAME == 'Drama': posts = posts.filter(Submission.sub == None)
else:
if subsonly:
posts = posts.filter(Submission.sub != None)
if v and v.all_blocks: posts = posts.filter(Submission.sub.notin_(v.all_blocks))
elif v and v.all_blocks: posts = posts.filter(or_(Submission.sub == None, Submission.sub.notin_(v.all_blocks)))
if subsonly:
posts = posts.filter(Submission.sub != None)
if v and v.all_blocks: posts = posts.filter(Submission.sub.notin_(v.all_blocks))
elif SITE_NAME == 'Drama': posts = posts.filter(Submission.sub == None)
elif v and v.all_blocks: posts = posts.filter(or_(Submission.sub == None, Submission.sub.notin_(v.all_blocks)))
if gt: posts = posts.filter(Submission.created_utc > gt)
if lt: posts = posts.filter(Submission.created_utc < lt)
@ -356,12 +355,11 @@ def frontlist(v=None, sort="hot", page=1, t="all", ids_only=True, ccmode="false"
elif subs:
if v and v.all_blocks: pins = pins.filter(or_(Submission.sub == None, Submission.sub.notin_(v.all_blocks)))
else:
if SITE_NAME == 'Drama': pins = pins.filter(Submission.sub == None)
else:
if subsonly:
pins = pins.filter(Submission.sub != None)
if v and v.all_blocks: pins = pins.filter(Submission.sub.notin_(v.all_blocks))
elif v and v.all_blocks: pins = pins.filter(or_(Submission.sub == None, Submission.sub.notin_(v.all_blocks)))
if subsonly:
pins = pins.filter(Submission.sub != None)
if v and v.all_blocks: pins = pins.filter(Submission.sub.notin_(v.all_blocks))
elif SITE_NAME == 'Drama': pins = pins.filter(Submission.sub == None)
elif v and v.all_blocks: pins = pins.filter(or_(Submission.sub == None, Submission.sub.notin_(v.all_blocks)))
if v and v.admin_level == 0:
blocking = [x[0] for x in g.db.query(UserBlock.target_id).filter_by(user_id=v.id).all()]