From 49f69cb688469fb83446f81bbd4e382f92e2f06e Mon Sep 17 00:00:00 2001 From: retoor Date: Tue, 26 Nov 2024 07:17:53 +0100 Subject: [PATCH] Ffs. --- src/rupload/app.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/rupload/app.py b/src/rupload/app.py index 755aea2..c4a8b7a 100644 --- a/src/rupload/app.py +++ b/src/rupload/app.py @@ -246,7 +246,7 @@ async def handle_upload(request: web.Request): uploaded_url = request.app.generate_upload_url(filename) print(f"File {filename} is now available at: {uploaded_url}.") return web.HTTPFound( - "/?message=File is succesfully uploaded and is available here:" + "/?message=File is succesfully uploaded and is available here: " + uploaded_url ) print("No file uploaded.") @@ -265,10 +265,11 @@ async def handle_index(request: web.Request): message = request.query.get("message", "") if request.app.is_upload_folder_quota_reached: message = "Server reached quota! Contact administrator." - if request.app.upload_url in message: + if "is available here: " in message: url = message[message.find("here: ") + len("here: "):] - message = message.replace("here: ", f"here: {url}' + message = message[: message.find("here: ")+len("here: ")] + message = += "") + message += f"{url}" if message: message += "

" html_content = html_content.replace("[message]", message)