X-Git-Url: https://git.mdrn.pl/wolnelektury.git/blobdiff_plain/f17e5ab1f46f52b071f71c799dfa4c755f7c407e..3b432b134c57aad46da1eadebc31f01d35368719:/apps/catalogue/views.py diff --git a/apps/catalogue/views.py b/apps/catalogue/views.py index d9ae442aa..79faca7a4 100644 --- a/apps/catalogue/views.py +++ b/apps/catalogue/views.py @@ -164,7 +164,7 @@ def tagged_object_list(request, tags=''): objects = fragments else: # get relevant books and their tags - objects = models.Book.tagged.with_all(tags).order_by() + objects = models.Book.tagged.with_all(tags) if not shelf_is_set: # eliminate descendants l_tags = models.Tag.objects.filter(category='book', slug__in=[book.book_tag_slug() for book in objects]) @@ -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'):