X-Git-Url: https://git.mdrn.pl/wolnelektury.git/blobdiff_plain/599ce05dcf12a1380c3a2181b694aed06f55fffd..96390ae52c2017ae4fb9a61831beeb68c808a2f6:/src/api/handlers.py?ds=inline diff --git a/src/api/handlers.py b/src/api/handlers.py index d32981e04..eb18e0502 100644 --- a/src/api/handlers.py +++ b/src/api/handlers.py @@ -19,8 +19,8 @@ from api.models import BookUserData from catalogue.forms import BookImportForm from catalogue.models import Book, Tag, BookMedia, Fragment, Collection from catalogue.models.tag import prefetch_relations -from catalogue.utils import is_subscribed from librarian.cover import WLCover +from paypal.rest import user_is_subscribed from picture.models import Picture from picture.forms import PictureImportForm from social.utils import likes @@ -330,7 +330,7 @@ class BooksHandler(BookDetailHandler): class EpubHandler(BookDetailHandler): def read(self, request, slug): - if not is_subscribed(request.user): + if not user_is_subscribed(request.user): return rc.FORBIDDEN try: book = Book.objects.get(slug=slug) @@ -730,7 +730,7 @@ class UserDataHandler(BaseHandler): if not request.user.is_authenticated(): return rc.FORBIDDEN if slug is None: - return {'username': request.user.username, 'premium': is_subscribed(request.user)} + return {'username': request.user.username, 'premium': user_is_subscribed(request.user)} try: book = Book.objects.get(slug=slug) except Book.DoesNotExist: