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/a6c32d2f0b2e99b74332a0a2b14293ee03b4470e?ds=sidebyside;hp=-c fixes #814: 404 when no html --- a6c32d2f0b2e99b74332a0a2b14293ee03b4470e diff --git a/apps/catalogue/views.py b/apps/catalogue/views.py index 556bae1fe..8630ebf61 100644 --- a/apps/catalogue/views.py +++ b/apps/catalogue/views.py @@ -257,6 +257,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'):