From e98b97842e8f0e0741305d17aa805f0ae824e934 Mon Sep 17 00:00:00 2001 From: j <0x006A@0x2620.org> Date: Thu, 20 Nov 2014 13:24:43 +0000 Subject: [PATCH] send 404 not 500 if document does not exist --- pandora/document/views.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pandora/document/views.py b/pandora/document/views.py index 1aa50b13..1e301909 100644 --- a/pandora/document/views.py +++ b/pandora/document/views.py @@ -274,7 +274,7 @@ def file(request, id, name=None): def thumbnail(request, id, size=256, page=None): size = int(size) - document = models.Document.get(id) + document = get_document_or_404_json(id) return HttpFileResponse(document.thumbnail(size, page=page)) @login_required_json