From 4b3d44536da6af7be2918327f6869a748805c44a Mon Sep 17 00:00:00 2001 From: Jack Eilles Date: Fri, 12 Jan 2024 09:38:43 +0000 Subject: [PATCH] more. MORE. MOOOOOOORE. --- app/routes.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/routes.py b/app/routes.py index 7862fd0..dff6309 100644 --- a/app/routes.py +++ b/app/routes.py @@ -169,12 +169,12 @@ def delete(id): data = Config.files.find_one({"id": id}) - if data["userid"] == current_user.userid: + if data["userid"] == request.form.get("userid") and bcrypt.check_password_hash(Config.user.find_one({"userid": data["userid"]})["idpass"], request.form.get("idpass")): Config.files.delete_one({"id": id}) os.remove(os.path.join(Config.fileDir, secure_filename(id))) return "File deleted." - elif data["userid"] == request.form.get("userid") and bcrypt.check_password_hash(Config.user.find_one({"userid": data["userid"]})["idpass"], request.form.get("idpass")): + elif data["userid"] == current_user.userid: Config.files.delete_one({"id": id}) os.remove(os.path.join(Config.fileDir, secure_filename(id))) return "File deleted."