views.py 513 Bytes
Newer Older
1
2
3
4
5
6
7
8
9
10
11
12
13
14
from rest_framework.permissions import IsAuthenticated
from rest_framework.response import Response
from rest_framework.views import APIView

from members.api.permissions import SentryIdentityPermission
from members.api.serializers import SentryIdentitySerializer


class SentryIdentityView(APIView):
    permission_classes = (IsAuthenticated, SentryIdentityPermission)

    def get(self, request, format=None):
        serializer = SentryIdentitySerializer(request.user)
        return Response(serializer.data)