X-Git-Url: https://git.mdrn.pl/redakcja.git/blobdiff_plain/43116c58e5c56f94ef358a5a17fb13a252e02531..64def8585cd770750020addd02e959b2f9a9426f:/apps/catalogue/views.py?ds=sidebyside diff --git a/apps/catalogue/views.py b/apps/catalogue/views.py index a3978304..1436fc02 100644 --- a/apps/catalogue/views.py +++ b/apps/catalogue/views.py @@ -477,8 +477,17 @@ 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 [ + (_('books'), reverse('catalogue_document_list')), + (self.object.title, self.object.get_absolute_url()), + (_('scan gallery'),), + ] def get_directory(self): return "%s%s/" % (settings.IMAGE_DIR, self.object.gallery) -