2
0
mirror of https://expo.survex.com/repositories/troggle/.git synced 2026-04-11 15:28:44 +01:00

making test more robust

This commit is contained in:
2025-12-16 19:29:00 +00:00
parent 7789590796
commit 120e632bcb
2 changed files with 10 additions and 4 deletions

View File

@@ -399,6 +399,12 @@ def photoupload(request, folder=None):
message = f'\n !! Permissions failure ?! 0 attempting to mkdir "{(ctx["yearpath"] / newphotographer)}"'
print(message)
return render(request, "errors/generic.html", {"message": message})
# refresh directory listing so the response shows the newly created folder
try:
dirs = [f.name for f in ctx["yearpath"].iterdir() if f.is_dir()]
except FileNotFoundError:
dirs = []
ctx["dirs"] = sorted(dirs)
return ctx
# else form for uploads / renames