Ensure PFP is not empty before uploading
This commit is contained in:
parent
197a5ab242
commit
477c61c4b6
@ -56,7 +56,7 @@ def create_app(test_config=None):
|
||||
db.execute("INSERT INTO user_settings (user_id, lang, theme) VALUES (?, ?, ?)",
|
||||
(session["user_id"], form["language"], form["theme"]))
|
||||
|
||||
if "pfp" in files:
|
||||
if "pfp" in files and files["pfp"].filename != "":
|
||||
stored_filename = str(uuid.uuid4())
|
||||
pfp = files["pfp"]
|
||||
pfp.save(os.path.join(app.config["PFP_STORE"], stored_filename))
|
||||
|
Loading…
Reference in New Issue
Block a user