From e078028f1a8da34f3cc2cb5095b8e103a996f553 Mon Sep 17 00:00:00 2001 From: zhaoqingang <zhaoqg0118@163.com> Date: 星期五, 11 四月 2025 10:16:42 +0800 Subject: [PATCH] 首页智能体中心过滤掉自研类型 --- app/api/organization.py | 8 ++++---- 1 files changed, 4 insertions(+), 4 deletions(-) diff --git a/app/api/organization.py b/app/api/organization.py index eab77c7..e5e73a6 100644 --- a/app/api/organization.py +++ b/app/api/organization.py @@ -19,7 +19,7 @@ async def add_dept(dept: DeptInfo, current_user: UserModel = Depends(get_current_user), db=Depends(get_db)): if not dept.deptName: return Response(code=400, msg="The deptName cannot be empty!") - if dept.status not in ["0", "1"]: + if dept.status not in ["0", "1", 0, 1]: return Response(code=400, msg="The status cannot be {}!".format(dept.status)) is_create = await create_dept(db, dept.deptName, dept.leader, dept.phone, dept.address, dept.status, dept.orderNum, dept.roles, dept.groups, dept.parentId) if not is_create: @@ -62,9 +62,9 @@ @dept_router.put("/status", response_model=Response) async def edit_status_api(dept: DeptStatus, current_user: UserModel = Depends(get_current_user), db=Depends(get_db)): - if dept.status not in ["0", '1']: + if dept.status not in ["0", '1', 0, 1]: return Response(code=400, msg="鏈煡鐘舵�侊紒", data={}) - msg = await edit_organization_status(db, dept.deptId, dept.status) + msg = await edit_organization_status(db, dept.deptId, str(dept.status)) if msg: return Response(code=400, msg=f"{msg}", data={}) - return Response(code=200, msg="dept delete successfully", data={}) + return Response(code=200, msg="dept status update successfully", data={}) -- Gitblit v1.8.0