mirror of
https://github.com/imartinez/privateGPT.git
synced 2025-09-03 08:15:14 +00:00
Changes to register user
This commit is contained in:
@@ -203,7 +203,7 @@ def register(
|
|||||||
# password: str = Body(...),
|
# password: str = Body(...),
|
||||||
company_id: int = Body(None, title="Company ID",
|
company_id: int = Body(None, title="Company ID",
|
||||||
description="Company ID for the user (if applicable)"),
|
description="Company ID for the user (if applicable)"),
|
||||||
department_name: str = Body(None, title="Department Name",
|
department_id: str = Body(None, title="Department ID",
|
||||||
description="Department name for the user (if applicable)"),
|
description="Department name for the user (if applicable)"),
|
||||||
role_name: str = Body(None, title="Role Name",
|
role_name: str = Body(None, title="Role Name",
|
||||||
description="User role name (if applicable)"),
|
description="User role name (if applicable)"),
|
||||||
@@ -231,9 +231,9 @@ def register(
|
|||||||
status_code=404,
|
status_code=404,
|
||||||
detail="Company not found.",
|
detail="Company not found.",
|
||||||
)
|
)
|
||||||
if department_name:
|
if department_id:
|
||||||
department = crud.department.get_by_department_name(
|
department = crud.department.get_by_id(
|
||||||
db=db, name=department_name)
|
db=db, id=department_id)
|
||||||
if not department:
|
if not department:
|
||||||
raise HTTPException(
|
raise HTTPException(
|
||||||
status_code=404,
|
status_code=404,
|
||||||
|
Reference in New Issue
Block a user