2025-02-08 17:59:30 +01:00
|
|
|
from rest_framework.generics import RetrieveUpdateAPIView
|
2025-01-28 22:13:07 +01:00
|
|
|
from rest_framework.permissions import IsAuthenticated
|
|
|
|
from .serializers import UserSerializer
|
|
|
|
|
|
|
|
|
2025-02-08 17:59:30 +01:00
|
|
|
class ProfileView(RetrieveUpdateAPIView):
|
|
|
|
"""Retrieve and update the authenticated user's profile."""
|
2025-02-02 23:45:29 +01:00
|
|
|
|
2025-01-28 22:13:07 +01:00
|
|
|
permission_classes = [IsAuthenticated]
|
2025-02-08 17:59:30 +01:00
|
|
|
serializer_class = UserSerializer
|
2025-01-28 22:13:07 +01:00
|
|
|
|
2025-02-08 17:59:30 +01:00
|
|
|
def get_object(self):
|
|
|
|
return self.request.user
|