2
0
mirror of https://expo.survex.com/repositories/troggle/.git synced 2026-02-08 13:18:15 +00:00

bugfixes and more comments

This commit is contained in:
2024-12-19 22:55:08 +00:00
parent 19bbb00dcc
commit 011e6777c9
7 changed files with 57 additions and 10 deletions

View File

@@ -71,8 +71,14 @@ def map(request):
def mapfile(request, path):
"""Serves unadorned file: everything in the /map/... folder tree"""
fn = Path(settings.EXPOWEB, "map", path)
print(f"MAP cuttout. \n{path=}\n{fn=} mime:{getmimetype(fn)}")
return HttpResponse(content=open(fn, "r"), content_type=getmimetype(fn))
if fn.is_file():
print(f"MAP cuttout. \n{path=}\n{fn=} mime:{getmimetype(fn)}")
return HttpResponse(content=open(fn, "r"), content_type=getmimetype(fn))
else:
message = f"### File not found ### {fn}"
print(message)
return render(request, "errors/generic.html", {"message": message})
def expofilessingle(request, filepath):