Merge pull request #3385 from danihodovic/refactor/remove-user-api-methods

refactor: remove user API methods parameter
This commit is contained in:
Bruno Alla 2021-11-09 08:27:47 +00:00 committed by GitHub
commit 5e906a6636
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -19,7 +19,7 @@ class UserViewSet(RetrieveModelMixin, ListModelMixin, UpdateModelMixin, GenericV
assert isinstance(self.request.user.id, int) assert isinstance(self.request.user.id, int)
return self.queryset.filter(id=self.request.user.id) return self.queryset.filter(id=self.request.user.id)
@action(detail=False, methods=["GET"]) @action(detail=False)
def me(self, request): def me(self, request):
serializer = UserSerializer(request.user, context={"request": request}) serializer = UserSerializer(request.user, context={"request": request})
return Response(status=status.HTTP_200_OK, data=serializer.data) return Response(status=status.HTTP_200_OK, data=serializer.data)