2
0
mirror of https://expo.survex.com/repositories/troggle/.git synced 2024-11-22 07:11:52 +00:00

refactorisation to make debugging easier

This commit is contained in:
Martin Green 2022-06-18 23:13:40 +01:00
parent 41dfe08d2a
commit 6bcf70bb8b

View File

@ -223,7 +223,9 @@ def expopage(request, path):
filetobeopened = os.path.normpath(expowebpath / path)
try:
return HttpResponse(content=open(unicode(filetobeopened, 'utf8'), "rb"), content_type=getmimetype(path))
content = open(filetobeopened, "rb"
content_type=getmimetype(path)
return HttpResponse(content = content, content_type=content_type)
except IOError:
return render(request, 'pagenotfound.html', {'path': path}, status="404")