This commit is contained in:
Martin Green 2022-06-19 01:52:09 +01:00
parent 945373df67
commit 8372d9d85c

View File

@ -123,8 +123,7 @@ def expofilesdir(request, dirpath, filepath):
def expowebpage(request, expowebpath, path):
'''Adds menus and serves an HTML page
'''
p = path.encode(sysdefaultencoding)
if not Path(expowebpath / p).is_file():
if not os.path.is_file(os.path.normpath(expowebpath / path).encode(sysdefaultencoding):
# Should not get here if the path has suffix "_edit"
print(f' - 404 error in expowebpage() {path}')
return render(request, 'pagenotfound.html', {'path': path}, status="404")