sfddsf
This commit is contained in:
parent
ff2f5275f8
commit
7d35b8cd12
3 changed files with 27 additions and 24 deletions
|
@ -762,13 +762,11 @@ def settings_images_banner(v):
|
|||
@validate_formkey
|
||||
def settings_delete_profile(v):
|
||||
|
||||
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.profileurl or v.highres:
|
||||
v.deletepfp()
|
||||
g.db.add(v)
|
||||
g.db.commit()
|
||||
|
||||
v.highres = None
|
||||
v.profileurl = None
|
||||
g.db.add(v)
|
||||
g.db.commit()
|
||||
return render_template("settings_profile.html", v=v,
|
||||
msg="Profile picture successfully removed.")
|
||||
|
||||
|
@ -779,8 +777,7 @@ def settings_delete_profile(v):
|
|||
def settings_delete_banner(v):
|
||||
|
||||
if v.bannerurl:
|
||||
if '/images/' in v.bannerurl: os.remove('/images/' + v.bannerurl.split('/images/')[1])
|
||||
v.bannerurl = None
|
||||
v.deletebanner()
|
||||
g.db.add(v)
|
||||
g.db.commit()
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue