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
try:
author, title, book_id = after.split(SORT_KEY_SEP)
except ValueError:
- return []
+ return Book.objects.none()
return books.filter(Q(sort_key_author__gt=author)
| (Q(sort_key_author=author) & Q(sort_key__gt=title))
| (Q(sort_key_author=author) & Q(sort_key=title) & Q(id__gt=int(book_id))))
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)
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: