#1483: txt generation only for non-empty books
authorRadek Czajka <radoslaw.czajka@nowoczesnapolska.org.pl>
Fri, 13 May 2011 12:13:48 +0000 (14:13 +0200)
committerRadek Czajka <radoslaw.czajka@nowoczesnapolska.org.pl>
Fri, 13 May 2011 12:13:48 +0000 (14:13 +0200)
apps/catalogue/models.py

index 2b6a2cc..2202cc1 100644 (file)
@@ -621,8 +621,8 @@ class Book(models.Model):
                 new_fragment.save()
                 new_fragment.tags = set(book_tags + themes + [book_tag] + ancestor_tags)
 
                 new_fragment.save()
                 new_fragment.tags = set(book_tags + themes + [book_tag] + ancestor_tags)
 
-        if not settings.NO_BUILD_TXT and build_txt:
-            book.build_txt()
+            if not settings.NO_BUILD_TXT and build_txt:
+                book.build_txt()
 
         if not settings.NO_BUILD_EPUB and build_epub:
             book.root_ancestor.build_epub()
 
         if not settings.NO_BUILD_EPUB and build_epub:
             book.root_ancestor.build_epub()