fnp
/
wolnelektury.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
fix
[wolnelektury.git]
/
src
/
catalogue
/
api
/
fields.py
diff --git
a/src/catalogue/api/fields.py
b/src/catalogue/api/fields.py
index
80de4ab
..
64eab24
100644
(file)
--- a/
src/catalogue/api/fields.py
+++ b/
src/catalogue/api/fields.py
@@
-1,5
+1,5
@@
-# This file is part of Wolne
l
ektury, licensed under GNU Affero GPLv3 or later.
-# Copyright © Fundacja
Nowoczesna Polska
. See NOTICE for more information.
+# This file is part of Wolne
L
ektury, licensed under GNU Affero GPLv3 or later.
+# Copyright © Fundacja
Wolne Lektury
. See NOTICE for more information.
#
from rest_framework import serializers
from api.fields import AbsoluteURLField
#
from rest_framework import serializers
from api.fields import AbsoluteURLField
@@
-15,7
+15,9
@@
class BookLiked(serializers.ReadOnlyField):
request = self.context['request']
if not hasattr(request, 'liked_books'):
if request.user.is_authenticated:
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:
else:
request.liked_books = None
if request.liked_books is not None: