Gallery-Archivist/backend/api/user/views.py

14 lines
403 B
Python
Raw Normal View History

from rest_framework.generics import RetrieveUpdateAPIView
2025-01-28 22:13:07 +01:00
from rest_framework.permissions import IsAuthenticated
from .serializers import UserSerializer
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]
serializer_class = UserSerializer
2025-01-28 22:13:07 +01:00
def get_object(self):
return self.request.user