cxv
parent
485735f315
commit
8978b3a1b4
|
@ -338,7 +338,7 @@ def frontlist(v=None, sort="hot", page=1, t="all", ids_only=True, ccmode="false"
|
||||||
|
|
||||||
posts = posts[:size]
|
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)
|
pins = g.db.query(Submission).filter(Submission.stickied != None, Submission.is_banned == False)
|
||||||
if v and v.admin_level == 0:
|
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()]
|
blocking = [x[0] for x in g.db.query(UserBlock.target_id).filter_by(user_id=v.id).all()]
|
||||||
|
|
|
@ -638,8 +638,12 @@ def settings_images_profile(v):
|
||||||
|
|
||||||
if not imageurl: abort(400)
|
if not imageurl: abort(400)
|
||||||
|
|
||||||
if v.highres and '/images/' in v.highres : os.remove('/images/' + v.highres.split('/images/')[1])
|
if v.highres and '/images/' in v.highres:
|
||||||
if v.profileurl and '/images/' in v.profileurl : os.remove('/images/' + v.profileurl.split('/images/')[1])
|
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.highres = highres
|
||||||
v.profileurl = imageurl
|
v.profileurl = imageurl
|
||||||
g.db.add(v)
|
g.db.add(v)
|
||||||
|
@ -666,7 +670,9 @@ def settings_images_banner(v):
|
||||||
bannerurl = process_image(name)
|
bannerurl = process_image(name)
|
||||||
|
|
||||||
if bannerurl:
|
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
|
v.bannerurl = bannerurl
|
||||||
g.db.add(v)
|
g.db.add(v)
|
||||||
g.db.commit()
|
g.db.commit()
|
||||||
|
|
Loading…
Reference in New Issue