add(settings): password changing

This commit is contained in:
AdrienLSH
2024-03-19 13:59:21 +01:00
parent a3be4681cc
commit 68ceec22eb
13 changed files with 234 additions and 99 deletions

View File

@ -0,0 +1,13 @@
from ..serializers.update_password import UpdatePasswordSerializer
from rest_framework.generics import UpdateAPIView
from rest_framework.permissions import IsAuthenticated
from django.contrib.auth.models import User
class UpdatePasswordView(UpdateAPIView):
queryset = User.objects.all()
permission_classes = (IsAuthenticated,)
serializer_class = UpdatePasswordSerializer
def get_object(self):
return self.queryset.get(pk=self.request.user.pk)