X-Git-Url: https://git.mdrn.pl/wolnelektury.git/blobdiff_plain/ffe2226ec60937c4cf3829839ba94c5091d427a6..3726f9b225fb5c39cbf067f53d4cf6f7d8a9f326:/apps/api/handlers.py diff --git a/apps/api/handlers.py b/apps/api/handlers.py index da5c0ed27..b436024b1 100644 --- a/apps/api/handlers.py +++ b/apps/api/handlers.py @@ -18,6 +18,7 @@ from api.helpers import timestamp from api.models import Deleted from catalogue.forms import BookImportForm from catalogue.models import Book, Tag, BookMedia, Fragment, Collection +from catalogue.utils import related_tag_name from picture.models import Picture from picture.forms import PictureImportForm @@ -244,7 +245,7 @@ def _tags_getter(category): def _tag_getter(category): @classmethod def get_tag(cls, book): - return ", ".join(t[0] for t in book.related_info()['tags'].get(category, [])) + return ", ".join(related_tag_name(t) for t in book.related_info()['tags'].get(category, [])) return get_tag for plural, singular in category_singular.items(): setattr(BookDetails, plural, _tags_getter(singular))