X-Git-Url: https://git.mdrn.pl/redakcja.git/blobdiff_plain/17ed87c493556adae66975e6cee1454b74e0c904..8e8b2c44fc1345b2b4ae2806f2ef5f2187d760c0:/src/cover/views.py?ds=sidebyside diff --git a/src/cover/views.py b/src/cover/views.py index a12dce73..d00123cc 100644 --- a/src/cover/views.py +++ b/src/cover/views.py @@ -22,7 +22,7 @@ from cover import forms from cover.utils import get_import_data -PREVIEW_SIZE = (216, 300) +PREVIEW_SIZE = (212, 300) def preview(request, book, chunk=None, rev=None): @@ -31,7 +31,10 @@ def preview(request, book, chunk=None, rev=None): If chunk and rev number are given, use version from given revision. If rev is not given, use publishable version. """ - chunk = Chunk.get(book, chunk) + try: + chunk = Chunk.get(book, chunk) + except Chunk.DoesNotExist: + raise Http404 if chunk.book.cover and rev is None and not request.GET.get('width') and not request.GET.get('height'): return HttpResponseRedirect(chunk.book.cover.url)