From cd38df987a460a3dbe115ecddd6652641f04708e Mon Sep 17 00:00:00 2001 From: wuaho Date: Tue, 28 Sep 2021 13:49:41 +0800 Subject: [PATCH] =?UTF-8?q?=E8=A7=A3=E5=86=B3=E6=8A=A5=E8=A1=A8=E6=8E=92?= =?UTF-8?q?=E5=BA=8Fbug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- api/api_v1/endpoints/report.py | 2 +- schemas/dashboard.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/api/api_v1/endpoints/report.py b/api/api_v1/endpoints/report.py index cb0b84c..0f61b30 100644 --- a/api/api_v1/endpoints/report.py +++ b/api/api_v1/endpoints/report.py @@ -96,7 +96,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)) + reports = sorted(reports, key=lambda x: x.get('show_config', {}).get('sort',999) or 999) return schemas.Msg(code=0, msg='ok', data=reports) diff --git a/schemas/dashboard.py b/schemas/dashboard.py index 96c30a2..6e22552 100644 --- a/schemas/dashboard.py +++ b/schemas/dashboard.py @@ -35,7 +35,7 @@ class Report(BaseModel): ascending: bool = None model: str = None graph_size: str = None - sort: int = None + sort: int = 999 modelswitch: bool = None