feed fix
authorRadek Czajka <radoslaw.czajka@nowoczesnapolska.org.pl>
Thu, 29 Dec 2011 09:34:20 +0000 (10:34 +0100)
committerRadek Czajka <radoslaw.czajka@nowoczesnapolska.org.pl>
Thu, 29 Dec 2011 09:34:20 +0000 (10:34 +0100)
apps/catalogue/feeds.py
apps/catalogue/models/book.py

index 8bb21c3..a185ae3 100755 (executable)
@@ -13,6 +13,9 @@ class PublishTrackFeed(Feed):
     def get_object(self, request, slug):
         return get_object_or_404(Chunk.tag_model, slug=slug)
 
     def get_object(self, request, slug):
         return get_object_or_404(Chunk.tag_model, slug=slug)
 
+    def item_title(self, item):
+        return item.title
+
     def items(self, obj):
         return Book.objects.filter(public=True, _on_track__gte=obj.ordering
                 ).order_by('-_on_track', 'title')
     def items(self, obj):
         return Book.objects.filter(public=True, _on_track__gte=obj.ordering
                 ).order_by('-_on_track', 'title')
index 7154775..89c6267 100755 (executable)
@@ -271,7 +271,8 @@ class Book(models.Model):
     def get_on_track(self):
         if self.published:
             return -1
     def get_on_track(self):
         if self.published:
             return -1
-        stages = [ch.stage.ordering for ch in self if ch.stage is not None]
+        stages = [ch.stage.ordering if ch.stage is not None else 0
+                    for ch in self]
         if not len(stages):
             return 0
         return min(stages)
         if not len(stages):
             return 0
         return min(stages)