From: Radek Czajka Date: Tue, 7 Sep 2010 07:58:05 +0000 (+0200) Subject: fixes #814: 404 when no html X-Git-Url: https://git.mdrn.pl/wolnelektury.git/commitdiff_plain/22a9e609d7f00bac9d88306d3c9f4cf3bd244dee?ds=sidebyside fixes #814: 404 when no html --- diff --git a/apps/catalogue/views.py b/apps/catalogue/views.py index d9ae442aa..088d0eee6 100644 --- a/apps/catalogue/views.py +++ b/apps/catalogue/views.py @@ -262,6 +262,8 @@ def book_stub_detail(request, slug): def book_text(request, slug): book = get_object_or_404(models.Book, slug=slug) + if not book.has_html_file(): + raise Http404 book_themes = {} for fragment in book.fragments.all(): for theme in fragment.tags.filter(category='theme'):