From b98c836c0a9753be78225c9530039f5fe9a32d0f Mon Sep 17 00:00:00 2001 From: Johan Vandegriff Date: Thu, 1 Jul 2021 11:56:23 -0400 Subject: [PATCH] added instructions to correct mistakes, fixed file naming --- boggle.py | 8 +++++--- templates/boggle/upload.html | 1 + 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/boggle.py b/boggle.py index 31c350e..f8a882f 100644 --- a/boggle.py +++ b/boggle.py @@ -566,10 +566,12 @@ def request_data(form, files): filename = upload.filename.replace("'","") #filter out ' destination = IMAGE_UPLOAD_DIR + filename i=0 - while os.path.exists(destination): - spl = os.path.splitext(destination) - destination = spl[0] + "_" + str(i) + spl[1] + destination_extra = destination + spl = os.path.splitext(destination) + while os.path.exists(destination_extra): + destination_extra = spl[0] + "_" + str(i) + spl[1] i += 1 + destination = destination_extra # save file print("File saved to to:", destination) upload.save(destination) diff --git a/templates/boggle/upload.html b/templates/boggle/upload.html index e501def..44f5937 100644 --- a/templates/boggle/upload.html +++ b/templates/boggle/upload.html @@ -92,6 +92,7 @@
+

tap/click on the letters that are wrong to change them

-- 2.34.2