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