From 78c1c7cecf38c45f55b3dcfa195ef3945ac5dc5e Mon Sep 17 00:00:00 2001 From: skywalker Date: Wed, 23 Oct 2024 10:49:45 +0800 Subject: [PATCH] upgrade pydantic from 1.x to 2.x --- .../console/connected_space_router.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/packages/watchmen-rest-doll/src/watchmen_rest_doll/console/connected_space_router.py b/packages/watchmen-rest-doll/src/watchmen_rest_doll/console/connected_space_router.py index b5f785170..8be94a694 100644 --- a/packages/watchmen-rest-doll/src/watchmen_rest_doll/console/connected_space_router.py +++ b/packages/watchmen-rest-doll/src/watchmen_rest_doll/console/connected_space_router.py @@ -414,7 +414,7 @@ class TemplateConnectedSpace(ExtendedBaseModel): @router.get( '/connected_space/template/list', tags=[UserRole.CONSOLE, UserRole.ADMIN], - response_model=List[TemplateConnectedSpace]) + response_model=None) async def find_all_template_connected_spaces( space_id: Optional[SpaceId], principal_service: PrincipalService = Depends(get_console_principal) ) -> List[TemplateConnectedSpace]: @@ -450,7 +450,7 @@ def action() -> List[TemplateConnectedSpace]: return trans_readonly(connected_space_service, action) -@router.get('/connected_space/export', tags=[UserRole.ADMIN], response_model=List[ConnectedSpaceWithSubjects]) +@router.get('/connected_space/export', tags=[UserRole.ADMIN], response_model=None) async def find_template_connected_spaces_for_export( principal_service: PrincipalService = Depends(get_admin_principal) ) -> List[ConnectedSpaceWithSubjects]: @@ -470,7 +470,7 @@ def action() -> List[ConnectedSpaceWithSubjects]: return trans_readonly(connected_space_service, action) -@router.delete('/connected_space', tags=[UserRole.SUPER_ADMIN], response_model=ConnectedSpaceWithSubjects) +@router.delete('/connected_space', tags=[UserRole.SUPER_ADMIN], response_model=None) async def delete_connected_space_by_id_by_super_admin( connect_id: Optional[ConnectedSpaceId] = None, principal_service: PrincipalService = Depends(get_super_admin_principal) @@ -543,10 +543,10 @@ def add_column_type_to_subjects(subjects: List[Subject], principal_service) -> L return ArrayHelper(subject_list_with_type).map(lambda x: add_dataset_column_type(x, principal_service)).to_list() -@router.get('/connected_space/template/subjects', tags=[UserRole.ADMIN], response_model=List[Subject]) +@router.get('/connected_space/template/subjects', tags=[UserRole.ADMIN], response_model=None) async def find_template_subjects_by_id( principal_service: PrincipalService = Depends( - get_admin_principal)): + get_admin_principal)) -> List[Subject]: connected_space_service = get_connected_space_service(principal_service) def action() -> List[Subject]: