@@ -29,7 +29,8 @@ async def option_pager(
2929 pagination = PaginationParams (page = pageNum , size = pageSize )
3030 paginator = Paginator (session )
3131 stmt = select (UserModel .id , UserModel .account , UserModel .name ).where (
32- ~ exists ().where (UserWsModel .uid == UserModel .id , UserWsModel .oid == oid )
32+ ~ exists ().where (UserWsModel .uid == UserModel .id , UserWsModel .oid == oid ),
33+ UserModel .id != 1
3334 ).order_by (UserModel .create_time )
3435
3536 if keyword :
@@ -51,12 +52,15 @@ async def option_user(
5152 current_user : CurrentUser ,
5253 keyword : str = Query (description = "搜索关键字" )
5354 ):
55+ if not keyword :
56+ raise HTTPException ("keyword is required" )
5457 if (not current_user .isAdmin ) and current_user .weight == 0 :
5558 raise RuntimeError ("no permission to execute this api" )
5659 oid = current_user .oid
5760
5861 stmt = select (UserModel .id , UserModel .account , UserModel .name ).where (
59- ~ exists ().where (UserWsModel .uid == UserModel .id , UserWsModel .oid == oid )
62+ ~ exists ().where (UserWsModel .uid == UserModel .id , UserWsModel .oid == oid ),
63+ UserModel .id != 1
6064 )
6165
6266 if keyword :
@@ -89,6 +93,7 @@ async def pager(
8993 UserWsModel , UserModel .id == UserWsModel .uid
9094 ).where (
9195 UserWsModel .oid == workspace_id ,
96+ UserModel .id != 1
9297 ).order_by (UserModel .create_time )
9398
9499 if keyword :
0 commit comments