Added a missing 404 response

- Legacy-Id: 18334
This commit is contained in:
Henrik Levkowetz 2020-07-31 12:59:20 +00:00
parent 0c4d58a9f7
commit ab7abb5975

View file

@ -203,10 +203,13 @@ def materials_document(request, document, num=None, ext=None):
# This view does not allow the use of DocAliases. Right now we are probably only creating one (identity) alias, but that may not hold in the future.
doc = Document.objects.filter(name=name).first()
# Handle edge case where the above name, rev splitter misidentifies the end of a document name as a revision mumber
if rev and not doc:
name = name + '-' + rev
rev = None
doc = get_object_or_404(Document, name=name)
if not doc:
if rev:
name = name + '-' + rev
rev = None
doc = get_object_or_404(Document, name=name)
else:
raise Http404("No such document")
if not doc.meeting_related():
raise Http404("Not a meeting related document")