from .models import BookUserData
from . import serializers
from .request_validator import PistonRequestValidator
-from .utils import oauthlib_request, oauthlib_response
+from .utils import oauthlib_request, oauthlib_response, vary_on_auth
class OAuth1RequestTokenEndpoint(RequestTokenEndpoint):
return urlencode(token.items())
+# Never Cache
class OAuth1RequestTokenView(View):
def __init__(self):
self.endpoint = OAuth1RequestTokenEndpoint(PistonRequestValidator())
return urlencode(token.items())
+# Never cache
class OAuth1AccessTokenView(View):
def __init__(self):
self.endpoint = OAuth1AccessTokenEndpoint(PistonRequestValidator())
)
+@vary_on_auth
class UserView(RetrieveAPIView):
permission_classes = [IsAuthenticated]
serializer_class = serializers.UserSerializer
return self.request.user
+@vary_on_auth
class BookUserDataView(RetrieveAPIView):
permission_classes = [IsAuthenticated]
serializer_class = serializers.BookUserDataSerializer