remotes/1693045480750635534/spooky-22
Aevann1 2022-02-01 00:20:05 +02:00
parent 485735f315
commit 8978b3a1b4
2 changed files with 10 additions and 4 deletions

View File

@ -338,7 +338,7 @@ def frontlist(v=None, sort="hot", page=1, t="all", ids_only=True, ccmode="false"
posts = posts[:size]
if (sort == "hot" or (v and v.id == Q_ID)) and page == 1:
if (sort == "hot" or (v and v.id == Q_ID)) and page == 1 and ccmode == "false":
pins = g.db.query(Submission).filter(Submission.stickied != None, Submission.is_banned == False)
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()]

View File

@ -638,8 +638,12 @@ def settings_images_profile(v):
if not imageurl: abort(400)
if v.highres and '/images/' in v.highres : os.remove('/images/' + v.highres.split('/images/')[1])
if v.profileurl and '/images/' in v.profileurl : os.remove('/images/' + v.profileurl.split('/images/')[1])
if v.highres and '/images/' in v.highres:
fpath = '/images/' + v.highres.split('/images/')[1]
if path.isfile(fpath): os.remove(fpath)
if v.profileurl and '/images/' in v.profileurl:
fpath = '/images/' + v.profileurl.split('/images/')[1]
if path.isfile(fpath): os.remove(fpath)
v.highres = highres
v.profileurl = imageurl
g.db.add(v)
@ -666,7 +670,9 @@ def settings_images_banner(v):
bannerurl = process_image(name)
if bannerurl:
if v.bannerurl and '/images/' in v.bannerurl : os.remove('/images/' + v.bannerurl.split('/images/')[1])
if v.bannerurl and '/images/' in v.bannerurl:
fpath = '/images/' + v.bannerurl.split('/images/')[1]
if path.isfile(fpath): os.remove(fpath)
v.bannerurl = bannerurl
g.db.add(v)
g.db.commit()