X-Git-Url: https://git.mdrn.pl/wolnelektury.git/blobdiff_plain/e5e8226c4d4bd610de5983e69b1b13684a17fe75..69b59e1dc5d93547a298830fc439a5608ebd6596:/apps/api/handlers.py?ds=inline 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',