X-Git-Url: https://git.mdrn.pl/wolnelektury.git/blobdiff_plain/0534cba3ab83d0d10e52c2c27eb6387c9763481b..ddaff853c515ef7d188523d9ef17d271901dd581:/apps/api/handlers.py diff --git a/apps/api/handlers.py b/apps/api/handlers.py index 91a3f4bb9..437b3be4c 100644 --- a/apps/api/handlers.py +++ b/apps/api/handlers.py @@ -106,7 +106,7 @@ class BookDetails(object): @classmethod def author(cls, book): - return ",".join(t[0] for t in book.related_info()['tags']['author']) + return ",".join(t[0] for t in book.related_info()['tags'].get('author', [])) @classmethod def href(cls, book): @@ -410,7 +410,7 @@ class CatalogueHandler(BaseHandler): def book_dict(book, fields=None): all_fields = ['url', 'title', 'description', 'gazeta_link', 'wiki_link', - ] + Book.formats + BookMedia.formats + [ + ] + Book.formats + BookMedia.formats.keys() + [ 'parent', 'parent_number', 'tags', 'license', 'license_description', 'source_name',