fixes #814: 404 when no html
authorRadek Czajka <radoslaw.czajka@nowoczesnapolska.org.pl>
Tue, 7 Sep 2010 07:58:05 +0000 (09:58 +0200)
committerRadek Czajka <radoslaw.czajka@nowoczesnapolska.org.pl>
Mon, 13 Sep 2010 11:11:16 +0000 (13:11 +0200)
apps/catalogue/views.py

index 556bae1..8630ebf 100644 (file)
@@ -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'):