Return 404 if meeting materials not found.

- Legacy-Id: 14019
This commit is contained in:
Henrik Levkowetz 2017-08-01 10:56:10 +00:00
parent aaf3fa54d8
commit 2846a2d58d

View file

@ -168,6 +168,8 @@ def materials_document(request, document, num=None, ):
raise Http404("No such document for meeting %s" % num)
filename = doc.get_file_name()
basename = doc.get_base_name()
if not os.path.exists(filename):
raise Http404("File not found: %s" % filename)
with open(filename, 'rb') as file:
bytes = file.read()