diff --git a/apps/users/serializers.py b/apps/users/serializers.py index c5c476e..637ca96 100644 --- a/apps/users/serializers.py +++ b/apps/users/serializers.py @@ -38,3 +38,21 @@ class Meta: "skills", "image", ) + + +class UserUpdateSerializer(serializers.ModelSerializer): + class Meta: + model = User + fields = ( + "first_name", + "last_name", + "phone_number", + "date_of_birth", + "address", + "job_title", + "department", + "education", + "employment_start_date", + "skills", + "image", + ) diff --git a/apps/users/views.py b/apps/users/views.py index 3c0e06c..bc79770 100644 --- a/apps/users/views.py +++ b/apps/users/views.py @@ -2,7 +2,11 @@ from rest_framework.permissions import AllowAny from django.contrib.auth import get_user_model -from apps.users.serializers import SignupSerializer, UserSerializer +from apps.users.serializers import ( + SignupSerializer, + UserSerializer, + UserUpdateSerializer, +) User = get_user_model() @@ -25,7 +29,7 @@ def get_object(self): class UserDetailUpdateView(generics.UpdateAPIView): queryset = User.objects.all() - serializer_class = UserSerializer + serializer_class = UserUpdateSerializer def get_object(self): return self.request.user