Fix old PFP removal logic

This commit is contained in:
Kiril Kovachev 2024-10-21 10:22:30 +01:00
parent e00c9fe431
commit 677e0868d2

View File

@ -60,8 +60,8 @@ def create_app(test_config=None):
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))
if settings and settings["pfp_filename"]:
os.remove(os.path.join(app.config["PFP_STORE"], settings["pfp_filename"]))
db.execute("UPDATE user_settings SET pfp_filename = ?", (stored_filename,))