create fix
Some checks failed
Build Docker / build (push) Has been cancelled
Build Docker / deploy (push) Has been cancelled

This commit is contained in:
2026-03-07 01:11:35 +03:00
parent ea0b339d69
commit 869d2d5199
2 changed files with 7 additions and 1 deletions

View File

@@ -45,7 +45,12 @@ async def update_user(data: pydantic.UserUpdate, user=Depends(get_current_user))
@api.post("/create", response_model=pydantic.UserAccess)
async def create_user(user_info: pydantic.UserCreate,user=Depends(check_roles)):
await db.create_user(user_info)
user = await db.create_user(user_info)
if user == None:
raise HTTPException(
status_code=status.HTTP_409_CONFLICT,
detail="Code already exists for another user"
)
return user_info
@api.get("/list")