From b4883c8bdcf7d97a20271a25546f39992448f56a Mon Sep 17 00:00:00 2001 From: Jan Szejko Date: Thu, 23 Aug 2018 17:04:07 +0200 Subject: [PATCH] premium info in user data api --- src/api/handlers.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/api/handlers.py b/src/api/handlers.py index d050f0fac..0814fd4c4 100644 --- a/src/api/handlers.py +++ b/src/api/handlers.py @@ -669,14 +669,14 @@ class PictureHandler(BaseHandler): class UserDataHandler(BaseHandler): model = BookUserData - fields = ('state', 'username') + fields = ('state', 'username', 'premium') allowed_methods = ('GET', 'POST') def read(self, request, slug=None): if not request.user.is_authenticated(): return rc.FORBIDDEN if slug is None: - return {'username': request.user.username} + return {'username': request.user.username, 'premium': is_subscribed(request.user)} try: book = Book.objects.get(slug=slug) except Book.DoesNotExist: -- 2.20.1