fix user password bug
This commit is contained in:
@@ -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()
|
||||
|
||||
Reference in New Issue
Block a user