refactor: remove user API methods parameter

`methods` defaults to ["GET"] if not specified. There is no need to
explicitly set this in the action.

71e6c30034/rest_framework/decorators.py (L145)
This commit is contained in:
Dani Hodovic 2021-11-08 21:07:13 +01:00
parent 4cd205b19c
commit 8483bbbdf2
No known key found for this signature in database
GPG Key ID: 15433E10A71D1221

View File

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