X-Git-Url: https://git.mdrn.pl/wolnelektury.git/blobdiff_plain/4e361d55331351f56077e5f9999ecb4ee7e93819..6535d2e28106edd90589a6a2376cf52a796adf3e:/src/catalogue/api/fields.py?ds=sidebyside diff --git a/src/catalogue/api/fields.py b/src/catalogue/api/fields.py index 80de4ab34..d95c3a857 100644 --- a/src/catalogue/api/fields.py +++ b/src/catalogue/api/fields.py @@ -15,7 +15,9 @@ class BookLiked(serializers.ReadOnlyField): request = self.context['request'] if not hasattr(request, 'liked_books'): if request.user.is_authenticated: - request.liked_books = set(Book.tagged.with_any(request.user.tag_set.all()).values_list('id', flat=True)) + request.liked_books = set( + Book.tagged.with_any(request.user.tag_set.all()).values_list('id', flat=True) + ) else: request.liked_books = None if request.liked_books is not None: