fixes to vierwer/folding catalogue in menu
[wolnelektury.git] / apps / catalogue / models / book.py
index 0438afa..30b4471 100644 (file)
@@ -74,6 +74,7 @@ class Book(models.Model):
         from sortify import sortify
 
         self.sort_key = sortify(self.title)
+        self.title = unicode(self.title) # ???
 
         ret = super(Book, self).save(force_insert, force_update, **kwargs)
 
@@ -495,7 +496,7 @@ class Book(models.Model):
         book = self
         rel_info = book.related_info()
         names = [(related_tag_name(tag), Tag.create_url('author', tag['slug']))
-                    for tag in rel_info['tags']['author']]
+                    for tag in rel_info['tags'].get('author', ())]
         if 'parents' in rel_info:
             books = [(name, Book.create_url(slug))
                         for name, slug in rel_info['parents']]