From 1d9627881824257ef225fb655ce147cabf5c9091 Mon Sep 17 00:00:00 2001 From: wuaho Date: Mon, 11 Oct 2021 14:58:27 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=AD=A3=E6=8A=A5=E8=A1=A8=E6=8E=92?= =?UTF-8?q?=E5=BA=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- api/api_v1/endpoints/report.py | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/api/api_v1/endpoints/report.py b/api/api_v1/endpoints/report.py index 0f61b30..ee89f60 100644 --- a/api/api_v1/endpoints/report.py +++ b/api/api_v1/endpoints/report.py @@ -83,11 +83,9 @@ async def read_report( dashboard = await crud.dashboard.get(db, id=data_in.dashboard_id) # projection = {'query': False} projection = None - reports = await crud.report.read_report(db,project_id=data_in.project_id, + reports = await crud.report.read_report(db, project_id=data_in.project_id, projection=projection, **ext_where) - - for item in reports: item['added'] = False # item['name'] = item['name'] @@ -96,7 +94,7 @@ async def read_report( if item['_id'] in added_ids: item['added'] = True item['show_config'] = added_ids[item['_id']] - reports = sorted(reports, key=lambda x: x.get('show_config', {}).get('sort',999) or 999) + reports = sorted(reports, key=lambda x: x.get('show_config', {'sort': 999}).get('sort', 999)) return schemas.Msg(code=0, msg='ok', data=reports)