diff --git a/app/routers/users.py b/app/routers/users.py index efdb31e..ef5850d 100644 --- a/app/routers/users.py +++ b/app/routers/users.py @@ -1,4 +1,4 @@ -from fastapi import APIRouter, Depends, HTTPException, status +from fastapi import APIRouter, Depends, HTTPException, status, Response from fastapi.responses import JSONResponse from datetime import datetime from ..dependencies import users_token, permissions_checker, database @@ -104,8 +104,8 @@ async def update_users_id(authorize: Annotated[bool, Depends(permissions_checker user = user_repository.find_one_by({"username": {'$eq': userSingle.username}}) if user is None: - response.status_code = status.HTTP_201_CREATED - user = users.User() + Response.status_code = status.HTTP_201_CREATED + user = users.User(username=userSingle.username, password=users_token.get_password_hash(userSingle.password), email=userSingle.email) user.username = userSingle.username user.password = users_token.get_password_hash(userSingle.password) user.roles = userSingle.roles