summaryrefslogtreecommitdiffstats
path: root/core
diff options
context:
space:
mode:
authorPhilip Sargent <philip.sargent@gmail.com>2023-07-31 16:16:43 +0300
committerPhilip Sargent <philip.sargent@gmail.com>2023-07-31 16:16:43 +0300
commit8d9b320d8949c448e38ab6b836b2851ca412cb5e (patch)
tree54c9f4386567ea95035a665640d0e7c4f6deda6b /core
parent89c1c653402f0c1199476755d106437bdee19ca4 (diff)
downloadtroggle-8d9b320d8949c448e38ab6b836b2851ca412cb5e.tar.gz
troggle-8d9b320d8949c448e38ab6b836b2851ca412cb5e.tar.bz2
troggle-8d9b320d8949c448e38ab6b836b2851ca412cb5e.zip
filesize now shown
Diffstat (limited to 'core')
-rw-r--r--core/views/uploads.py8
1 files changed, 6 insertions, 2 deletions
diff --git a/core/views/uploads.py b/core/views/uploads.py
index 31250cb..04f486d 100644
--- a/core/views/uploads.py
+++ b/core/views/uploads.py
@@ -34,7 +34,9 @@ todo = """
- Enable folder creation in dwguploads or as a separate form
-- Enable file rename on expofiles, particularly in /surveyscans/ (aka wallets)
+- Enable file rename on expofiles, not just for /surveyscans/ (aka wallets)
+
+- Make file rename utility less ugly.
"""
class FilesForm(forms.Form): # not a model-form, just a form-form
@@ -69,7 +71,8 @@ def expofilerename(request, filepath):
return render(request, "errors/generic.html", {"message": message})
else:
filename = Path(filepath).name
- folder = Path(actualpath).parent
+ folder = actualpath.parent
+ filesize = f"{actualpath.stat().st_size:,}"
if not actualpath.is_relative_to(Path(settings.SCANS_ROOT)):
message = f'\n Can only do rename within wallets (expofiles/surveyscans/) currently, sorry. "{actualpath}" '
@@ -101,6 +104,7 @@ def expofilerename(request, filepath):
"form": form,
"filepath": filepath,
"filename": filename,
+ "filesize": filesize,
},
)