2
0
mirror of https://expo.survex.com/repositories/troggle/.git synced 2025-12-15 18:57:13 +00:00

Bug: create year directory if a new year

This commit is contained in:
2025-02-17 21:32:31 +02:00
parent 95878e630d
commit 6c30a9ffcb

View File

@@ -311,7 +311,7 @@ def photoupload(request, folder=None):
if formd.is_valid():
newphotographer = sanitize_name(request.POST["photographer"])
try:
(yearpath / newphotographer).mkdir(exist_ok=True)
(yearpath / newphotographer).mkdir(parents=True, exist_ok=True)
except:
message = f'\n !! Permissions failure ?! 0 attempting to mkdir "{(yearpath / newphotographer)}"'
print(message)
@@ -453,10 +453,11 @@ def gpxupload(request, folder=None):
newprospector = sanitize_name(request.POST["prospector"])
print(f"gpxupload() {newprospector=}")
try:
(yearpath / newprospector).mkdir(exist_ok=True)
(yearpath / newprospector).mkdir(parents=True, exist_ok=True)
except:
message = f'\n !! Permissions failure ?! 0 attempting to mkdir "{(yearpath / newprospector)}"'
print(message)
raise
return render(request, "errors/generic.html", {"message": message})
else: