Remove old profile pictures once new ones are set
This commit is contained in:
parent
009cb6aade
commit
e00c9fe431
@ -59,6 +59,10 @@ def create_app(test_config=None):
|
|||||||
pfp = files["pfp"]
|
pfp = files["pfp"]
|
||||||
pfp.save(os.path.join(app.config["PFP_STORE"], stored_filename))
|
pfp.save(os.path.join(app.config["PFP_STORE"], stored_filename))
|
||||||
|
|
||||||
|
# Remove old PFP
|
||||||
|
if settings and settings["pfp"]:
|
||||||
|
os.remove(os.path.join(app.config["PFP_STORE"], stored_filename))
|
||||||
|
|
||||||
db.execute("UPDATE user_settings SET pfp_filename = ?", (stored_filename,))
|
db.execute("UPDATE user_settings SET pfp_filename = ?", (stored_filename,))
|
||||||
|
|
||||||
db.commit()
|
db.commit()
|
||||||
|
Loading…
Reference in New Issue
Block a user