From: Radek Czajka Date: Mon, 26 Jun 2023 10:00:03 +0000 (+0200) Subject: Minor fix X-Git-Url: https://git.mdrn.pl/redakcja.git/commitdiff_plain/2de0fde86873c879961365b4b9ce3904a158e84f?ds=sidebyside Minor fix --- diff --git a/src/cover/views.py b/src/cover/views.py index a12dce73..e89e7962 100644 --- a/src/cover/views.py +++ b/src/cover/views.py @@ -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)