From 921b54ab7c462259946a71d0bdc2938bb11b0d6c Mon Sep 17 00:00:00 2001 From: xoliqberdiyev Date: Mon, 27 Apr 2026 17:47:20 +0500 Subject: [PATCH] change url --- core/apps/accounts/urls.py | 2 +- core/apps/accounts/views/user.py | 7 +++---- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/core/apps/accounts/urls.py b/core/apps/accounts/urls.py index 38ff5f1..c460801 100644 --- a/core/apps/accounts/urls.py +++ b/core/apps/accounts/urls.py @@ -30,5 +30,5 @@ urlpatterns = [ path("user/list/", UserListApiView.as_view(), name="user-list"), path("admin-user/list/", AdminUserListApiView.as_view(), name="admin-user-list"), path("admin/create/", AdminCreateAPIView.as_view(), name="user-create"), - path("admin/update/", AdminUpdateAPIView.as_view(), name="user-update"), + path("admin/update//", AdminUpdateAPIView.as_view(), name="user-update"), ] diff --git a/core/apps/accounts/views/user.py b/core/apps/accounts/views/user.py index 7a63242..c0e5a9d 100644 --- a/core/apps/accounts/views/user.py +++ b/core/apps/accounts/views/user.py @@ -64,11 +64,10 @@ class AdminCreateAPIView(APIView): return Response(serializer.data, status=201) -@extend_schema(tags=['User'], - responses={200: UserSerializer}, - request=UserCreateSerializer) -class AdminUpdateAPIView(APIView): +@extend_schema(tags=['User'],) +class AdminUpdateAPIView(generics.GenericAPIView): permission_classes = [IsAuthenticated] + serializer_class = UserCreateSerializer def put(self, request, pk): if request.user.role not in (RoleChoice.SUPERUSER, RoleChoice.ADMIN):