Database cleanup, better UUID passing and construction (User model).

This commit is contained in:
2026-01-27 01:25:52 +00:00
parent 4ddaa9fdf4
commit 0f29544bdb
5 changed files with 68 additions and 56 deletions
+3 -7
View File
@@ -463,16 +463,12 @@ async def admin_create_user(
role_obj = next((r for r in roles if r.display_name == role_name), None)
if not role_obj:
raise ValueError("Role not found in organization")
user_uuid = uuid4()
user = UserDC(
uuid=user_uuid,
user = UserDC.create(
display_name=display_name,
role_uuid=role_obj.uuid,
visits=0,
created_at=None,
role=role_obj.uuid,
)
db.create_user(user, ctx=ctx)
return {"uuid": str(user_uuid)}
return {"uuid": str(user.uuid)}
@app.patch("/orgs/{org_uuid}/users/{user_uuid}/role")