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
def process(category, slug):
if category == 'book':
+ # FIXME: Unused?
try:
books.append(Book.objects.get(slug=slug))
except Book.DoesNotExist:
model = Book
fields = book_list_fields
+ # FIXME: Unused?
@classmethod
def genres(cls, book):
""" Returns all media for a book. """
are returned.
"""
if pk is not None:
+ # FIXME: Unused?
try:
return Book.objects.get(pk=pk)
except Book.DoesNotExist:
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)
def read(self, request, category=None, pk=None):
""" Lists all tags in the category (eg. all themes). """
if pk is not None:
+ # FIXME: Unused?
try:
return Tag.objects.exclude(category='set').get(pk=pk)
except Book.DoesNotExist:
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:
class UserShelfHandler(BookDetailHandler):
fields = book_list_fields + ['liked']
+ # FIXME: Unused?
def parse_bool(self, s):
if s in ('true', 'false'):
return s == 'true'