Added a missing 404 response
- Legacy-Id: 18334
This commit is contained in:
parent
0c4d58a9f7
commit
ab7abb5975
|
@ -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.
|
# 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()
|
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
|
# 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:
|
if not doc:
|
||||||
name = name + '-' + rev
|
if rev:
|
||||||
rev = None
|
name = name + '-' + rev
|
||||||
doc = get_object_or_404(Document, name=name)
|
rev = None
|
||||||
|
doc = get_object_or_404(Document, name=name)
|
||||||
|
else:
|
||||||
|
raise Http404("No such document")
|
||||||
|
|
||||||
if not doc.meeting_related():
|
if not doc.meeting_related():
|
||||||
raise Http404("Not a meeting related document")
|
raise Http404("Not a meeting related document")
|
||||||
|
|
Loading…
Reference in a new issue