X-Git-Url: https://git.mdrn.pl/redakcja.git/blobdiff_plain/babe7f68fcbb8f7e73f9b62d611715ca28b4c4e6..9744e2fc590942aede8ad253360c13acdb6e233f:/apps/catalogue/views.py?ds=sidebyside diff --git a/apps/catalogue/views.py b/apps/catalogue/views.py index e09940d6..1436fc02 100644 --- a/apps/catalogue/views.py +++ b/apps/catalogue/views.py @@ -477,7 +477,10 @@ def publish(request, slug): class GalleryView(UploadView): def get_object(self, request, slug): - return get_object_or_404(Book, slug=slug) + book = get_object_or_404(Book, slug=slug) + if not book.gallery: + raise Http404 + return book def breadcrumbs(self): return [