fnp
/
redakcja.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
17ed87c
)
Minor fix
author
Radek Czajka
<rczajka@rczajka.pl>
Mon, 26 Jun 2023 10:00:03 +0000
(12:00 +0200)
committer
Radek Czajka
<rczajka@rczajka.pl>
Mon, 26 Jun 2023 10:00:03 +0000
(12:00 +0200)
src/cover/views.py
patch
|
blob
|
history
diff --git
a/src/cover/views.py
b/src/cover/views.py
index
a12dce7
..
e89e796
100644
(file)
--- 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.
"""
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)
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)