[Fixed]-Get logged in users details and group permissions in rest api

1👍

✅

You must return a value with HttpResponse or another response function for your get_me function.

DRF way of doing this:

from rest_framework.response import Response
from rest_framework import status
from rest_framework.decorators import api_view

@api_view(['GET'])
def my_funct(request):
        user = request.user
        return Response({'user': UserGroupSerializer(user).data}, status=status.HTTP_200_OK)

Leave a comment