class UserProfile(viewsets.ModelViewSet):
.......
.......
#some codes here
.......
@csrf_exempt
def change_user_password(self, request):
#some actions here
if(condition):
UserProfile.patch(request)
..........
return ...
Здесь я привел пример кода, который может не работать. Но все, что мне нужно, это сделать вызов патча для UserProfile
класса viewset из функции change_user_password