fix user password bug

This commit is contained in:
2025-08-07 10:54:00 +03:30
parent 3420e9e832
commit fe6417b1c3
3 changed files with 6 additions and 3 deletions

View File

@@ -14,6 +14,7 @@ from apps.core.mixins.search_mixin import DynamicSearchMixin
from apps.core.pagination import CustomPageNumberPagination
from apps.authorization.api.v1 import api as authorize_view
from rest_framework.permissions import IsAuthenticated
from django.contrib.auth.hashers import make_password
from apps.authentication.tools import get_token_jti
from common.helpers import get_organization_by_user
from rest_framework.viewsets import ModelViewSet
@@ -57,7 +58,7 @@ class UserViewSet(ModelViewSet):
Customizing create user & bank account information with
permission levels
"""
request.data.update({'password': make_password(request.data['password'])})
serializer = self.serializer_class(data=request.data)
if serializer.is_valid():
user = serializer.save()