Skip to content

Commit ab7abb5

Browse files
committed
Added a missing 404 response
- Legacy-Id: 18334
1 parent 0c4d58a commit ab7abb5

1 file changed

Lines changed: 7 additions & 4 deletions

File tree

ietf/meeting/views.py

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -203,10 +203,13 @@ def materials_document(request, document, num=None, ext=None):
203203
# 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.
204204
doc = Document.objects.filter(name=name).first()
205205
# Handle edge case where the above name, rev splitter misidentifies the end of a document name as a revision mumber
206-
if rev and not doc:
207-
name = name + '-' + rev
208-
rev = None
209-
doc = get_object_or_404(Document, name=name)
206+
if not doc:
207+
if rev:
208+
name = name + '-' + rev
209+
rev = None
210+
doc = get_object_or_404(Document, name=name)
211+
else:
212+
raise Http404("No such document")
210213

211214
if not doc.meeting_related():
212215
raise Http404("Not a meeting related document")

0 commit comments

Comments
 (0)