解决报表排序bug

This commit is contained in:
wuaho 2021-09-28 13:49:41 +08:00
parent 94091e48ec
commit cd38df987a
2 changed files with 2 additions and 2 deletions

View File

@ -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)

View File

@ -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